emacs-devel
[Top][All Lists]
Advanced

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

Re: pcase-dolist


From: Stefan Monnier
Subject: Re: pcase-dolist
Date: Fri, 10 Jul 2015 15:04:19 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> Yes, but those don't have pcase in their name.

As mentioned earlier, I agree that the name is misleading (and it didn't
occur to me, because to me "pcase-" is just a prefix) this name is only
used because pcase-let uses the same pattern syntax and underlying
machinery as `pcase'.  We could rename it to `plet' (or even to just
`let').

> Hm, when you said that a better name for `pcase-dolist' was `dolist',
> wouldn't `let(*)' be a better name for `pcase-let(*)', too?

Yes.  2 reasons why it's not done:
- just as for dolist, I haven't made that jump (yet?), it's one of those
  things where there's no going back, so I need to work up my courage
  and convince myself it's worthwhile.
- since `let' is currently a builtin element, and used in the expansion
  of pcase-let, there are some technical details that'd need to be
  resolved (the technical issues for dolist are trivial in comparison).

> It would be very useful to be able to destructure in usual lets (like,
> e.g., in Clojure).

That's why I introduced pcase-let.

> AFAICS, the only thing that `pcase-let' is lacking is the ability to
> introduce locals without providing a value, e.g.,
>   (let ((x 1) b c) ...)

I tend to dislike these things, so I intentionally didn't add support
for them in pcase-let, but it'd be trivial to support them.


        Stefan



reply via email to

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