From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: How the backquote and the comma really work? Date: Tue, 14 Jul 2015 20:17:20 +0200 Message-ID: <87615mbo3z.fsf@mbork.pl> References: <87vbebg1fs.fsf@mbork.pl> <87r3ozy9pf.fsf@web.de> <87si9ffys0.fsf@mbork.pl> <87d20jbqbj.fsf@web.de> <87pp4jfx9y.fsf@mbork.pl> <87615sxn1a.fsf@mbork.pl> <87zj318j7z.fsf@web.de> <87mvz1b16h.fsf@mbork.pl> <87k2u5azfi.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1436897884 27510 80.91.229.3 (14 Jul 2015 18:18:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Jul 2015 18:18:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 14 20:17:48 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1ZF4m4-0003Sp-ES for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Jul 2015 20:17:48 +0200 Original-Received: from localhost ([::1]:60754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZF4m3-0001Ir-H7 for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Jul 2015 14:17:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZF4lt-0001Im-3X for help-gnu-emacs@gnu.org; Tue, 14 Jul 2015 14:17:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZF4lp-0002x9-0D for help-gnu-emacs@gnu.org; Tue, 14 Jul 2015 14:17:37 -0400 Original-Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:48606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZF4lo-0002vQ-KS for help-gnu-emacs@gnu.org; Tue, 14 Jul 2015 14:17:32 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id B61C94FA047 for ; Tue, 14 Jul 2015 20:17:29 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zTxFFJp6SBC2 for ; Tue, 14 Jul 2015 20:17:26 +0200 (CEST) Original-Received: from localhost (unknown [109.232.24.146]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 54CCD4FA03B for ; Tue, 14 Jul 2015 20:17:26 +0200 (CEST) In-reply-to: <87k2u5azfi.fsf@mbork.pl> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:5e00:2:52::8 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105719 Archived-At: On 2015-07-12, at 22:33, Marcin Borkowski wrote: > So, what about this? It seems to work. OTOH, I think it's not the mos= t > elegant thing possible, since there is some code duplication: mci/read > has this: (:open-paren (mci/read-list-contents)) in a (a)case statement= , > and mci/read-list-contents has this: (:open-paren (setq next > (mci/read-list-contents))). Something tells my mathematical mind that > there probably exists a cleaner approach. Stupid me =E2=80=93 again;-). No wonder =E2=80=98mci/read-list-contents=E2= =80=99 appears twice, once, once in =E2=80=98mci/read=E2=80=99 and once in =E2=80=98mci/read-li= st-contents=E2=80=99 =E2=80=93 it seems there=E2=80=99s no other way (though I can=E2=80=99t prove it formally). But now my problem is something different, and on a different level =E2=80= =93 a =E2=80=9Cmetaproblem=E2=80=9D in a sense. I=E2=80=99m still working on= =E2=80=98mci/eval=E2=80=99; it now supports =E2=80=98progn=E2=80=99 forms and =E2=80=98setq=E2=80=99, and I = have =E2=80=98cons=E2=80=99, =E2=80=98car=E2=80=99 and =E2=80=98cdr=E2=80= =99 as symbols bound to their Elisp counterparts in the global environment of my MCI, and when I have lambdas (and write =E2=80=98mci/apply=E2=80=99, w= hich should be relatively easy now), I=E2=80=99ll have more or less complete (though tin= y) Lisp. I guess that adding backquote should be really straightforward then. So where=E2=80=99s the problem? Well, it=E2=80=99s quite a lot of fun to= put it all together, and I=E2=80=99m learning a few things along the way, so it=E2=80= =99s difficult to resist the temptation to add more stuff. Macros? =E2=80=98cond=E2=80= =99 forms? =E2=80=98while=E2=80=99 forms? OTOH, my goal is *not* to recreate all El= isp (contrary to Scheme, Elisp is far from minimalistic, for instance, it has *a lot* of special forms which could, in principle, be macros - =E2=80=98if=E2=80= =99, for example, or =E2=80=98let=E2=80=99, or =E2=80=98let*=E2=80=99). I definit= ely do not want to spend too much time on this =E2=80=93 adding lots of special forms would soon cease= to be fun, and once (and if!) I have macros, there=E2=80=99s really no use in a= dding them; also, I want to move on to other things. So now my question is: does it make sense to play around with it more? Would a more complete Elisp interpreter written in Elisp be useful for anyone? If yes, I might consider publishing all my code sooner rather than later. And: if it=E2=80=99s interesting and/or useful for anybody, = is there anything besides lambdas, a proper =E2=80=98mci/apply=E2=80=99 func= tion and macros that definitely *should* be added? (One thing that comes to mind would be special (=3D dynamic) variables. I=E2=80=99m not sure whether I would= like to add them =E2=80=93 it might be too much work. OTOH, I=E2=80=99d learn to= implement dynamic binding then...) Best, --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University