[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: if-let/if-let*/and-let/..
From: |
Stefan Monnier |
Subject: |
Re: if-let/if-let*/and-let/.. |
Date: |
Wed, 14 Feb 2018 22:37:51 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> (if-let* (x) "dogs" "cats") => "cats"
We could detect this case and signal an error during macro-expansion for
it (the special (VAR EXP) form should be (VAR EXP) and not just
`(VAR)`).
> (if-let* (x (y 2)) "dogs" "cats") => (void-function y)
This is right. If you presume that `if-let` only takes the same syntax
as `let`, then the above would be equivalent to
(if-let* ((x nil) (y 2)) "dogs" "cats")
which is just a complicated way to write
"cats"
so it's rather unlikely that a user would write that on purpose.
It's much more likely that he meant
(if-let* (x (y 2)) "dogs" "cats")
to be treated as
(if-let* ((x (y 2))) "dogs" "cats")
which will indeed correctly give you the (void-function y).
> (if-let* (x (y 1) (z 2)) "dogs" "cats") => "cats"
Same as the first case above, we could/should detect this case during
macro-expansion since this is not of the form (VAR EXP) but (VAR EXP EXP).
Stefan
- if-let/if-let*/and-let/.., Stefan Monnier, 2018/02/11
- Message not available
- Message not available
- Re: if-let/if-let*/and-let/.., Mark Oteiza, 2018/02/13
- Re: if-let/if-let*/and-let/.., Stefan Monnier, 2018/02/13
- Re: if-let/if-let*/and-let/.., Mark Oteiza, 2018/02/13
- Re: if-let/if-let*/and-let/.., Michael Heerdegen, 2018/02/14
- Re: if-let/if-let*/and-let/..,
Stefan Monnier <=
- Re: if-let/if-let*/and-let/.., Michael Heerdegen, 2018/02/20
- Re: if-let/if-let*/and-let/.., Michael Heerdegen, 2018/02/21
- Re: if-let/if-let*/and-let/.., Stefan Monnier, 2018/02/22
- Re: if-let/if-let*/and-let/.., Michael Heerdegen, 2018/02/22
- Re: if-let/if-let*/and-let/.., Michael Heerdegen, 2018/02/13
- Re: if-let/if-let*/and-let/.., Eric Abrahamsen, 2018/02/13
- Re: if-let/if-let*/and-let/.., Michael Heerdegen, 2018/02/13
- Re: if-let/if-let*/and-let/.., Eric Abrahamsen, 2018/02/13