emacs-devel
[Top][All Lists]
Advanced

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

Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs]


From: Stefan Monnier
Subject: Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs]
Date: Mon, 18 May 2020 16:19:48 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> I understand your argument, particularly as it applies to the
> reader syntax.  On the other hand, dollar.el is just a macro: it
> does not complicate the syntax (for some definition of syntax);
> although it does complicate understanding when first presented.

Don't get me wrong: if I were to design Elisp from scratch, I'd most
probably choose a syntax for functions which has a handy "no explicit
parameter names" shorthand like `#(f % 1)` and also naturally
generalizes to the "fully explicit parameter names".

But I can't see a way to get a "shorthand" syntax sufficiently close to
the existing "longhand" syntax for this to work well.  I guess we could
try to do "the opposite" of what you do, and support

    (lambda [f $1 5])

which `prettify-symbols-mode` displays as

    (λ [f $1 5])

But even there, I'm not sure the benefit is worth the added complexity
for the occasional user trying to make sense of a few Elisp snippets.

> Would prettifying lambda to λ lead to visually unexpected indentation?

It does, occasionally, yes, as in:

    (lambda (x) (+ x
                   5))
vs
    (λ (x) (+ x
              5))

I know because I use `prettify-symbols-mode` ;-)


        Stefan




reply via email to

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