TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Mark on October 23, 2003, 02:54:10 PM

Title: NULL & NOT
Post by: Mark on October 23, 2003, 02:54:10 PM
Now that Mr. Madsen has returned, :D  I'll ask this question. Given the list.
Code: [Select]

(setq a 2 b 4 c nil d 8)
(setq lst '(a b c d))

why do these not work?
Code: [Select]

$ (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
_$


What am I missing Stig?
Title: NULL & NOT
Post by: SMadsen on October 23, 2003, 03:18:01 PM
Letting these statements speak for themselves:

Code: [Select]
(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))
Title: NULL & NOT
Post by: JohnK on October 23, 2003, 03:37:50 PM
Cool.