Code Red > AutoLISP (Vanilla / Visual)
NULL & NOT
(1/1)
Mark:
Now that Mr. Madsen has returned, :D I'll ask this question. Given the list.
--- Code: ---
(setq a 2 b 4 c nil d 8)
(setq lst '(a b c d))
--- End code ---
why do these not work?
--- Code: ---
$ (nth 2 lst)
C
_$ (null c)
T
_$ (not c)
T
_$ (null (nth 2 lst)) <-- here
nil
_$ (not (nth 2 lst)) <-- here
nil
_$
$ (type (nth 2 lst))
SYM
_$
--- End code ---
What am I missing Stig?
SMadsen:
Letting these statements speak for themselves:
--- Code: ---(setq a 2 b 4 c nil d 8)
(setq lst_1 '(a b c d)) -> (A B C D)
(setq lst_2 (list a b c d)) -> (2 4 nil 8)
(null 'C) -> nil
(null (eval C)) -> T
(null (nth 2 lst_1)) = (null 'C)
(null (nth 2 lst_2)) = (null (eval C))
--- End code ---
JohnK:
Cool.
Navigation
[0] Message Index
Go to full version