emacs-devel
[Top][All Lists]
Advanced

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

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


From: Oleh
Subject: Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal
Date: Fri, 23 Jan 2015 11:47:15 +0100

>> 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?
> This would be faster. It means that changes to reader-macro-alist
> wouldn't be reflected in code till it was re-evaled.
>
> My main concern with this as a proposal is that <letter> is a fairly
> small namespace. There is a lot of possibility for pretty disasterous
> clashes if this gets used in the wild.

How about this:

    #a(...) is (reader-macro-a ...)
    #b(...) is (reader-macro-b ...)

    ...

    #z(...) is (reader-macro-z ...)

This would be easy to implement, since this is just an extension of
the `backquote' and `short-lambda' method to 26 reader macros.

The core could take over some of them, and leave the rest open to the
public.



reply via email to

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