[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Better documentation for non-binding clauses of if-let and friends
From: |
Alfred M. Szmidt |
Subject: |
Re: Better documentation for non-binding clauses of if-let and friends |
Date: |
Mon, 11 Nov 2024 03:20:30 -0500 |
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.
> There is no mention of this in the manual, that only says that SPEC is
> like the one in LET*.
But I agree with you that the manual is incomplete or even
wrong here.
How about the following in section "Conditionals" instead
of what there currently is about these:
There's a number of variations on this theme, and they're briefly
described below.
For all of these SPEC is similar to what let* offers, with a few
extensions useful in the context of testing conditions: As with
let*, an element of SPEC which is a list (SYMBOL VALUEFORM) binds
SYMBOL to the value of VALUEFORM. An element can additionally be
of the form (VALUEFORM), which is evaluated and checked for nil;
i.e. SYMBOL can be omitted if only the test result is of
interest. It can also be of the form SYMBOL, then the binding of
SYMBOL is checked for nil.
For all of these SPEC is similar to what let* offers, with a few
extensions useful in the context of testing conditions:
That sentence doesn't add much, and will make the user guess if there
are other useful extentions -- "with the following extension" would
suffice I think.
As with
let*, an element of SPEC which is a list (SYMBOL VALUEFORM) binds
SYMBOL to the value of VALUEFORM. An element can additionally be
of the form (VALUEFORM),
which is evaluated and checked for nil;
i.e. SYMBOL can be omitted if only the test result is of
interest. It can also be of the form SYMBOL, then the binding of
SYMBOL is checked for nil.
-- Macro: if-let spec then-form else-forms...
Evaluate each binding in SPEC in turn, stopping if a binding
value or value form is ânilâ. If all are non-ânilâ, return
the value of THEN-FORM, otherwise the last form in
ELSE-FORMS.
The description here should explicitly mention that SPEC is _NOT_ a
binding if the spec only contains the VALUEFORM. And so should all
other descriptions.
-- ...
If needed, I can provide that or something similar as a patch ...
- RE: [External] : Re: Is this a bug in while-let or do I missunderstand it?, (continued)
- RE: [External] : Re: Is this a bug in while-let or do I missunderstand it?, Drew Adams, 2024/11/09
- Re: [External] : Re: Is this a bug in while-let or do I missunderstand it?, Alfred M. Szmidt, 2024/11/09
- Re: [External] : Re: Is this a bug in while-let or do I missunderstand it?, Jens Schmidt, 2024/11/09
- Re: [External] : Re: Is this a bug in while-let or do I missunderstand it?, Alfred M. Szmidt, 2024/11/09
- Re: [External] : Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/09
- Re: [External] : Re: Is this a bug in while-let or do I missunderstand it?, Alfred M. Szmidt, 2024/11/10
- Re: Better documentation for non-binding clauses of if-let and friends, Jens Schmidt, 2024/11/10
- Re: Better documentation for non-binding clauses of if-let and friends, Sean Whitton, 2024/11/10
- Re: Better documentation for non-binding clauses of if-let and friends, Jens Schmidt, 2024/11/10
- Re: Better documentation for non-binding clauses of if-let and friends, Alfred M. Szmidt, 2024/11/11
- Re: Better documentation for non-binding clauses of if-let and friends,
Alfred M. Szmidt <=
- Sv: [External] : Re: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/10
- RE: [External] : Re: Is this a bug in while-let or do I missunderstand it?, Drew Adams, 2024/11/09
- RE: [External] : Re: Is this a bug in while-let or do I missunderstand it?, Drew Adams, 2024/11/09
- Re: Is this a bug in while-let or do I missunderstand it?, John ff, 2024/11/14
- Sv: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/10
- Re: Is this a bug in while-let or do I missunderstand it?, Eli Zaretskii, 2024/11/10
- Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/10
- Re: Is this a bug in while-let or do I missunderstand it?, Alfred M. Szmidt, 2024/11/10
- Sv: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/10
- Sv: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/10