GNU bug report logs -
#73853
Should and-let* become a synonym for when-let*?
Previous Next
Full log
View this message in rfc822 format
>> Can we kill/deprecate this?
> `and-let*'s purpose is to express conditions, `when-let*'s is
> conditional evaluation. We have `and-let*' and `when-let*' for the same
> reason we have `and' and `when'. See prior discussions.
But there isn't the same "historical" support that justifies having
both, and the syntax&semantics of `and-let*` is just weird:
- Why allow a BODY if the motivation is to mirror the normal `and`?
If you want a BODY, use `when-let*`.
- What's the use of the final variable binding since (assuming you
don't use BODY) that variable is never used:
(and-let* ((a (fooa))
(b (foob a))
(i-m-useless (fooc a b))))
- There's a special syntax where the final binding can drop the variable
name (because of the previous point), which makes for an odd syntax
(and-let* ((a (fooa))
(b (foob a))
((weird-call a b))))
So the use with BODY is redundant with `when-let*` and the use without
BODY is quirky (and still redundant with `when-let*`, of course).
>> [ I think we have too many (if|when|and)-let(*) for our own good: we
>> should pick some winners and deprecate the other ones. ]
> AFAIR the non-star versions exist for backward compatibility only - so I
> would rather get rid of these. Parallel existence of these non-star
> vs. star versions should be a temporary state, it complicates the matter
> for an epsilon gain.
100% agreement. Can we `make-obsolete` the non-star versions?
>> I could see a use for something called `and-let(*)` but without a BODY,
>> for the purpose of remove a level of parens and indentation:
>>
>> (and-let*
>> (x1 (foo1))
>> (x2 (foo2)))
>>
>> i.s.o
>>
>> (and-let*
>> ((x1 (foo1))
>> (x2 (foo2))))
>
> Ugh! - I could not imagine anything with more potential for confusion as
> removing the paren around a list of bindings.
FWIW, I agree, I don't like that either.
Stefan
This bug report was last modified 140 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.