From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: How the backquote and the comma really work? Date: Tue, 21 Jul 2015 23:50:06 +0200 Message-ID: <87fv4hnptd.fsf@web.de> 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> 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 1437515459 18160 80.91.229.3 (21 Jul 2015 21:50:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jul 2015 21:50:59 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 21 23:50:51 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 1ZHfR4-0003Mk-Ha for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Jul 2015 23:50:50 +0200 Original-Received: from localhost ([::1]:33126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHfR3-00014i-Vh for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Jul 2015 17:50:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHfQg-00014V-KG for help-gnu-emacs@gnu.org; Tue, 21 Jul 2015 17:50:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHfQd-00087B-DD for help-gnu-emacs@gnu.org; Tue, 21 Jul 2015 17:50:26 -0400 Original-Received: from mout.web.de ([212.227.15.14]:59441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHfQd-00086S-3d for help-gnu-emacs@gnu.org; Tue, 21 Jul 2015 17:50:23 -0400 Original-Received: from drachen.dragon ([90.186.64.195]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0Lw1CH-1YsVlw3Pi9-017omq; Tue, 21 Jul 2015 23:50:14 +0200 In-Reply-To: <87mvz1b16h.fsf@mbork.pl> (Marcin Borkowski's message of "Sun, 12 Jul 2015 21:55:54 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:FC2CuCAu2m+v+6ogly0zT6doUNLNRaP/l18ZKtlFSy7RniXYaMn /FUiVAvxnBNBf4y0HMWlQvOeyCK0405rlwcWOlSLcJ/+Qw6uyXJSZCNwbihgEqFl3+jZkcT xYDFqU0vQF7eAqJeDll8U+IZzDd6qNsR4nFU1ptT9DgLEhnUVQP/6ZxwOWzYnPkhTjxIkvE M7Z2NvyERITbLZkqLYcQw== X-UI-Out-Filterresults: notjunk:1;V01:K0:/b4hJFqdumQ=:PnEWzVFWk+3YGaZprMXu/i gOavn7NR6ysQsS/a0BkEt5FaBjkGjqZWFuHSJ7yh4wAXecWzD1WUK3tcLwtaSR6RpZXsSUCJr lmmyo7Ug1VKnmPlN21mwI6nGp+xmUVVRi+/tAXS3VaDG3qSTJBVHWVJm6qv2NLde37lQRTz+W zs8uNonRr1qPSmMdQ33dc1MgnkC/Uel4It/6fGvTkp8X52EHXxKBwTN5qYDMsFVO7GheaHCUe 64olpwLtjJJbjNYmy5mEioK4Wr/YcakoRtGOU7Cjlf1POepndyIaA+7/QN93C8l0iPbQZGOO0 mpek2/60YvucjEWc8eZwvz/4ZXDl39NqjGST3Q4jx3oHc1PmA4WtXYBbPGwj8dcPK+ukYTqZI 06iWBtZY9x0zHaJsgUb2zDb48qbSC+avluG05Ot61XZaa6YET1gQClw5ZqDJyBJGP+wH3fDjP DeKWp1KIuBagQqCEpJbIG5pQyF0xfdRU6DMgheJM1JfSYekf2U457lBe8Hqa80P27vVxKi/Dm uHOHYe0qVCa8YrRg1QGJOxzoadue5aOxRIHcQxsYmYw4bZ9zR7FS6WKKgOncbDc+ntHC65SuQ RC+AH+XnbX0kdBZmHi2Wwqj0njbxpRYm+5OWmH0OHL2NmCoMy+ROEN4BBJNSCtgB65L/tFTOM YnuKQ7V2TToIYsevCyEAzBDRb7CeyeNMyUJLUtXZK/2HEzFtt9Ea1NNn4Pzu0eSQGEi8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.15.14 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:105911 Archived-At: Marcin Borkowski writes: > > sorry for the late reply. > > It's fine, I'm working slowly on this anyway. Sorry again. Was on vacation this time. > > Yes, that's the right approach. You could of course translate into the > > symbols named "'", "`" and "," instead, like the Lisp reader does, but > > that's a detail. In Elisp, these aren't special forms. They could be > > in your interpreter, of course. > > And they will be;-). FWIW, "," and ",@" are not defined in Elisp at all. They're just symbols used as tags that are recognized by `backquote'. > > Dunno if your interpreter will support macros. If not, you could > > handle backquote directly in your interpreter. > > No, I don't want to support macros =E2=80=93 too much work and little ben= efit, > I guess. Mmh, I don't think so. Macros are an essential part of the Lisp language. And I don't think it would be hard, it should be quite simple to do. `defmacro' kind of defines a function. The difference to real functions is that they get expressions (code) as arguments before evaluation; the expansion itself is just like a function call. The result is a new (expanded) expression to be evaluated. So if you have `funcall' and `apply', you already have everything you need to support macros. Your `eval' just has to use these to expand the macro calls before it starts with the conventional evaluation. > >> (require 'anaphora) ; we'll use acase > > > > It would be good if you could drop this dependence. This would spare > > people from trying your code from installing additional stuff. > > Well, aif is also useful for me. FWIW, there are now good replacements for such stuff in Emacs Lisp. You can use `if-let' (new in Emacs 25.1 coming soon) instead of `aif', and `pcase' (already part of Emacs) instead of `acase'. Learning `pcase' will take some time, but it is worth it. Lots of Lispers seems to hate these anaphoric macros and say they are unlispy. Lots of others love them. > > I guess you already know that you have not chosen the easiest way to > > understand backquote. Anyway, you learn a lot of stuff with your > > approach. Looking forward the next version! > > Not the easiest, but more thorough. I=E2=80=99m not satisfied with the = =E2=80=9CI kind > of understand this... I guess=E2=80=9D situation =E2=80=93 if I can=E2=80= =99t implement it, > I don=E2=80=99t understand it. (Unfortunately, the converse need not be = true; > I might be lucky and implement it without a full understanding, too...) Actually, I think it is not unusual for Lisp programming that you invent something, implement it, and understand it later. The same is probably true in some sense for Lisp itself. Regards, Michael.