[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cond construct for situation when a variable is t
From: |
Emanuel Berg |
Subject: |
Re: cond construct for situation when a variable is t |
Date: |
Tue, 22 Aug 2023 21:29:23 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Heime wrote:
>>> How can I use the 'cond' construct for the case when
>>> a variable is 't' ?
>>
>> It could look like this but in practice one would probably
>> put it in another way, that looks better.
>>
>> (setq var nil)
>>
>> (cond
>> (var 1)
>> ((not var) 0) )
>
> Which one looks better, the one you wrote with 0 and 1 ?
No, that was for demonstration purposes only, that what you
asked for is possible to do with `cond'.
In practice I think most people would find another solution to
express the same thing, but it is as valid so if you like it,
that is up to you.
>> You can, you totally can. Just don't `setq' t to anything :)
>
> Right, because one can set the letter t to something which
> would then screw up the idea that t means a truth condition.
And all code that relies on that idea :)
--
underground experts united
https://dataswamp.org/~incal