[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:32:28 +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) )
>
> > 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 ;)
>
> --
> underground experts united
> https://dataswamp.org/~incal
I am getting somewhat confused after your comments Emanuel. There is no
'boolean datatype' in elisp. With nil and empty list () being false,
anything else is true. That t is used for true, is that by convention ?
Should t be used, or is it unreliable ?