From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: User-defined record types Date: Fri, 18 Oct 2013 11:28:17 -0400 Message-ID: References: <85k3hlcqvm.fsf@junk.nocrew.org> <8561t5cclt.fsf@junk.nocrew.org> <85mwmgbb4l.fsf@junk.nocrew.org> <85vc12a36o.fsf_-_@junk.nocrew.org> <87a9i6ofzg.fsf@flea.lifelogs.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1382110114 15075 80.91.229.3 (18 Oct 2013 15:28:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Oct 2013 15:28:34 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 18 17:28:36 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VXByd-000833-MM for ged-emacs-devel@m.gmane.org; Fri, 18 Oct 2013 17:28:35 +0200 Original-Received: from localhost ([::1]:58312 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXByd-0004Ug-8j for ged-emacs-devel@m.gmane.org; Fri, 18 Oct 2013 11:28:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXByT-0004Qs-SM for emacs-devel@gnu.org; Fri, 18 Oct 2013 11:28:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VXByM-0007Rj-Ic for emacs-devel@gnu.org; Fri, 18 Oct 2013 11:28:25 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:47604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXByM-0007Rd-El for emacs-devel@gnu.org; Fri, 18 Oct 2013 11:28:18 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFLd+GD/2dsb2JhbABEvw4Xc4IeAQEEAVYoCws0EhQYDYhCBsEtjWGDKQOkeoFegxM X-IPAS-Result: Av4EABK/CFFLd+GD/2dsb2JhbABEvw4Xc4IeAQEEAVYoCws0EhQYDYhCBsEtjWGDKQOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="35811249" Original-Received: from 75-119-225-131.dsl.teksavvy.com (HELO pastel.home) ([75.119.225.131]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 18 Oct 2013 11:28:17 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 4D76E60FD2; Fri, 18 Oct 2013 11:28:17 -0400 (EDT) In-Reply-To: <87a9i6ofzg.fsf@flea.lifelogs.com> (Ted Zlatanov's message of "Fri, 18 Oct 2013 09:39:31 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:164310 Archived-At: > Something that represents JSON and YAML well would be nice. Currently > we don't have an ELisp data structure that can preserve all JSON nuances > without acrobatics (e.g. preserving the difference between "null" and > "empty list" or the native JSON data types). I don't understand what you mean here. It's very easy to have special values, e.g. (defconst json-null (make-symbol "json-null")). IIUC The problem of json.el is that it wants to provide a bridge between traditional Elisp data structures and JSON, and there is no reliable two-way conversion between the two. IIUC the current json.el focuses on making sure that converting to JSON and back returns the same object. But I don't see any technical difficulty writing a json2.el alternative which focuses on "to Elisp and back", i.e. when it reads a JSON object it returns an Elisp object that preserves all JSON nuances so that it can be reliably converted back to the "exact same" JSON object. > a native XML data structure would also be nice. We have what libxml > produces, dumped in an awkward tree, but nothing native. Not sure what "native" can mean in this context: we were talking about new Lisp-defined types. Whereas you seem to be talking about getting access to objects defined in other (non-Lisp) libraries, i.e. an FFI. Or maybe you're just talking about a more efficient representation for an XML/JSON tree. If Lisp-defined data types could offer that, it would be great, of course, but I personally don't see how that would work. Stefan