emacs-devel
[Top][All Lists]
Advanced

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

Re: Some improvements for cl-flet


From: Michael Heerdegen
Subject: Re: Some improvements for cl-flet
Date: Thu, 14 Oct 2021 06:00:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

akater <nuclearspace@gmail.com> writes:

> > Is there a good reason to support cl-symbol-macrolet at all?
> > It is a bizarre construct.
>
> People largely agree that with-slots is beneficial, for example.
> with-slots wouldn't be possible without symbol-macrolet.

I must say that at first I hated Richard's comments, but now I tend to
agree.

Most of our uses of `symbol-macrolet' are about places.  Like
`with-slots'.  So you can do (setf var expr).

But does the provided syntax have to look exactly like that?  Having
setting a variable change some place as side effect is slightly bizarre
indeed.  We could provide the same feature offering a syntax like

  (setf (place) expr)

where `place' is a local (normal) macro that "returns" a reference to
the according place.  Makes a bit more sense, conceptually.  With other
words: we could provide the same using `cl-macrolet' instead of
`symbol-macrolet'.

The only really different example is `thunk-let', a kind of lazy let I
already mentioned.  But (docstring): "It is not allowed to set
`thunk-let' or `thunk-let*' bound variables."  So there variable
abstraction also doesn't fit so well in that case.

I don't think we should remove `cl-symbol-macrolet', but I have the
impression that all current uses in Emacs could well work without symbol
macros.


Michael.



reply via email to

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