I ran into a problem when I'm not sure if everything is okay with me, which I have learned so far on Lisp.
In principle, the task is trivial: create a list containing only one element - the literal T
My first approach:
'(t)
It is right? In principle, he estimates
(T)
which seems right. Since the T character is evaluated on its own, this should do the job. But then it made me think ... If I write
'(s)
I get:
(S)
It looks about the same, but should be evaluated differently. So I thought about
(list t)
which also leads to:
(T)
If I compare characters using eq , they are equal:
(eq (car (list t)) (car '(t)))
And also, if I compare both values ββwith T directly, everything is fine:
(eq (car (list t)) t) (eq (car '(t)) t)
So, to shorten the long story: '(t) does the job, doesn't it?
lisp common-lisp
Golo roden
source share