On Jan 31, 2024, at 10:51 PM, Richard Stallman <rms@gnu.org> wrote:
[[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] I wonder why (bind*) evaluates only its first value to determine if the binding condition is true? We already have macros which evaluate the "truth of a set of bindings": the members of the if-let family. And they
"Evaluate each binding in turn, as in ‘let*’, stopping if a binding value is nil. If all are non-nil return the [final] value."
That does not seem natural to me at all. I don't see that it is better.
It's very natural and familiar to users of if/when/and-let (close to 1000 calls in core packages), since this description is copied verbatim from their docs. It is a natural way to avoid pre-calculating things you don't want to calculate until a prior step holds true.
A typical logical paths might be:
- Is some variable non-nil?
- Is it a plist?
- Does that plist has a :foobar element?
- Is that :foobar element's value a vector.
- Is slot 4 of that vector non-nil? Call it `result'.
- If all of the above are true, (do-something-with result)
|