help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cond construct for situation when a variable is t


From: Heime
Subject: Re: cond construct for situation when a variable is t
Date: Tue, 22 Aug 2023 12:18:10 +0000





Sent with Proton Mail secure email.

------- Original Message -------
On Wednesday, August 23rd, 2023 at 12:10 AM, Emanuel Berg <incal@dataswamp.org> 
wrote:


> 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 ?

Is it not recommended to use t ?
 
> > I can set a variable to boolean true using (setq var t), am
> > I right ?
> 
> 
> 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. 
 
> --
> underground experts united
> https://dataswamp.org/~incal



reply via email to

[Prev in Thread] Current Thread [Next in Thread]