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

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

RE: [External] : Re: cond construct for situation when a variable is t


From: Drew Adams
Subject: RE: [External] : Re: cond construct for situation when a variable is t
Date: Tue, 22 Aug 2023 21:07:24 +0000

> > > There is no 'boolean datatype' in elisp.
> > > With nil and empty list () being false,
> > > anything else is true.
> >
> >
> > There's no real true or false in Lisp. But yes,
> > that's the convention, and that convention is
> > baked into primitive conditionals, such as `if' and` cond'. So sure, you
> can think of it as
> > being more than a convention.
> >
> > > That t is used for true, is that by convention ?
> > > Should t be used, or is it unreliable ?
> >
> >
> > Just like the "convention" described above, it's
> > a convention. But also just like it, it's baked
> > into primitives. So yes, the constant `t' is a
> > typical non-nil value used by conditionals to
> > represent "true". And it's the canonical way to
> > represent "true", meaning that it's the clearest
> > way to tell human readers of code that "true" is
> > meant.
> 
> The canonical convention also stipulates that the symbol
> t is not to be modified to something else though, am I right ?

Dunno why it would stipulate that, as trying to
change its value raises an error, as I showed.

You can do practically anything in Lisp, so maybe
there's a way to change its value (you can certainly
change the value of a symbol `t' in a different
obarray, but that's not what we're talking about).

reply via email to

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