From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@newcastle.ac.uk (Phillip Lord) Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal Date: Fri, 23 Jan 2015 22:25:23 +0000 Message-ID: <87zj99gmng.fsf@newcastle.ac.uk> References: <54C15ECA.5050008@dancol.org> <87egqlvl86.fsf@newcastle.ac.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1422053572 20036 80.91.229.3 (23 Jan 2015 22:52:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Jan 2015 22:52:52 +0000 (UTC) Cc: Daniel Colascione , Oleh , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 23 23:52:51 2015 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 1YEn5v-0006vy-7a for ged-emacs-devel@m.gmane.org; Fri, 23 Jan 2015 23:52:51 +0100 Original-Received: from localhost ([::1]:33426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEn5u-0000l7-J2 for ged-emacs-devel@m.gmane.org; Fri, 23 Jan 2015 17:52:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEn5k-0000gm-Q8 for emacs-devel@gnu.org; Fri, 23 Jan 2015 17:52:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEn5g-0007pq-Uv for emacs-devel@gnu.org; Fri, 23 Jan 2015 17:52:40 -0500 Original-Received: from cheviot22.ncl.ac.uk ([128.240.234.22]:56623) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEn5g-0007pZ-Pz for emacs-devel@gnu.org; Fri, 23 Jan 2015 17:52:36 -0500 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129] helo=smtpauth.ncl.ac.uk) by cheviot22.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1YEn5e-0004E3-Fp; Fri, 23 Jan 2015 22:52:34 +0000 Original-Received: from cpc7-benw10-2-0-cust228.16-2.cable.virginm.net ([77.98.254.229] helo=localhost) by smtpauth.ncl.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1YEn5e-0001K9-5d; Fri, 23 Jan 2015 22:52:34 +0000 In-Reply-To: (Stefan Monnier's message of "Fri, 23 Jan 2015 15:52:09 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.240.234.22 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:181701 Archived-At: Stefan Monnier writes: >>>> Maybe we could introduce a more limited form of reader macros. >>>> E.g. allow # and make the reader return >>>> (funcall (cdr (assq reader-macro-alist)) ) >>> Would it not be possible to have the reader return a macro which could >>> do the cdr and assq at compile time and obviate the need for funcall? >> I like that. Because it solves the main problem I had with my proposal, >> which was to make `read' into something whose safety depends on >> "somewhat arbitrary Elisp code". > > Actually, no I think this is not good. The problem is that it means > such reader macros are just plain normal macros, i.e. they're only > expanded when they're in an "evaluated expression" position. > So you wouldn't be able to use them within a quoted list, for example. Ah, I'd misunderstood your original proposal to be honest. When you say "make the reader return (funcall (cdr (assq reader-macro-alist)) sexp)", you meant return the return value of the form, not return the form. Daniel was right, I hadn't understood the system. Phil