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: Mon, 13 Sep 2021 02:14:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

akater <nuclearspace@gmail.com> writes:

> > I see that a binding like (f (x y z)) is ambiguous.  But isn't that a
> > minor problem?
>
> No.  Syntax ambiguity is always a huge inconvenience.

I see your point.  OTOH, removing the expression syntax case would be a
backward incompatible change potentially break existing code - right?

> Even if I fail at convincing anyone that it should be dropped, I do
> wonder if this was indeed a Scheme influence.

A code example (to illustrate what cases we talk about) could look like:

#+begin_src emacs-lisp
(cl-flet ((multilinep (apply-partially #'string-match-p "\n")))
  (pcase something
    ((and (pred stringp) (pred multilinep)) ...)
    ...))
#+end_src

It's useful to be able to bind the result of some expression to a
symbol's function binding.  AFAIR I was one of those who wanted
`cl-flet' to support this, and I had not been inspired by Scheme much.

Personally I wouldn't mind when this functionality would be provided by
some other form, but there is backward compatibility.  And don't you
think that cl-lib (see Stefan's answer) differs from CL much more in
other aspects?

You can find discussions about to which degree cl-lib should be kept an
as strict as possible emulation of Common Lisp in the emacs dev and/or
bug mailing lists.  There were different opinions.  Undoubtedly the main
purpose of cl-lib today is just for writing Emacs Lisp code, however.

Michael.



reply via email to

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