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: Stefan Monnier
Subject: Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal
Date: Thu, 22 Jan 2015 18:36:29 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> That's a problem with any lisp that provides a reader-macro facility.
> The onus is on the authors of macro packages to create macros that work
> well with the existing emacs-lisp-mode parser.

That's a good point.

>>> So I'm currently against addition of CL style reader macros.
> Stefan, is emacs-lisp-mode support your only objection?

Yes and no.  No in the sense that I expect that introducing such reader
macros will have consequences that go further than just "emacs-lisp-mode
support".

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>)

So it would allow introducing a special regexp syntax #r"regexp" (which
would for example swap the meaning of ( and \( and things like that),
but it wouldn't allow defining "raw string" (backslashes would quote the
" just as usual).

> We already have plenty of libraries defining "control flow" structures;
> look at all the anaphoric-if libraries out there.

Agreed, and I think it's a good thing.


        Stefan



reply via email to

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