unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Better documentation for non-binding clauses of if-let and friends
@ 2024-11-11  9:28 arthur miller
  2024-11-11  9:58 ` Alfred M. Szmidt
  0 siblings, 1 reply; 10+ messages in thread
From: arthur miller @ 2024-11-11  9:28 UTC (permalink / raw)
  To: Alfred M. Szmidt, emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1368 bytes --]

>   I rather agree with Joost on that other thread regarding the
>   usefulness of the FOO-let macros and their condition-only,
>   non-binding clauses.
>
>I don't think anyone is arguing about their usefulness, only that the
>macros are too smart for their own good.

I think I will start argue against while-let usefulness :).

Now when I have seen that while-let is a special case of named-let,
I think that while-let is a bad construct for some reasons:

1. it is not general
2. the special case in which it does not work is hidden
3. the semantic of "read-only" loop variables is uncommon and unexpected

>   > There is no mention of this in the manual, that only says that SPEC is
>   > like the one in LET*.

That is the gotcha that got me: it says SPEC is "like let*", so this "-let*"
in the name take my mind to believe it established ordinary let*-bindings.
However, in while-let, these are not ordinary, but read-only. So they are
not the same, since they don't obey the ordinary behavior of let* bindings.

>   But I agree with you that the manual is incomplete or even
>   wrong here.

If that semantic of while-let is desirable to have, than the manual would
have to catch the details of while-let and its non-general nature, read-only
semantic of bindings and perhaps mention the named-let as a more general
 alternative.

[-- Attachment #2: Type: text/html, Size: 5172 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-11-12  8:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-11  9:28 Better documentation for non-binding clauses of if-let and friends arthur miller
2024-11-11  9:58 ` Alfred M. Szmidt
2024-11-11 10:23   ` Sv: " arthur miller
2024-11-11 10:26   ` Joost Kremers
2024-11-11 10:53     ` Sv: " arthur miller
2024-11-11 11:18       ` Joost Kremers
2024-11-11 21:21     ` [External] : " Drew Adams
2024-11-11 22:51       ` Joost Kremers
2024-11-12  0:26         ` Drew Adams
2024-11-12  8:07           ` Joost Kremers

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).