[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Clojure-like syntactic sugar for an anonymous function liter

From: Phillip Lord
Subject: Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal
Date: Fri, 23 Jan 2015 22:25:23 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>>>> Maybe we could introduce a more limited form of reader macros.
>>>> E.g. allow #<letter><sexp> and make the reader return
>>>> (funcall (cdr (assq <letter> reader-macro-alist)) <sexp>)
>>> 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 <letter> 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]