Author Topic: NULL & NOT  (Read 4768 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
NULL & NOT
« 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?
TheSwamp.org  (serving the CAD community since 2003)

SMadsen

  • Guest
NULL & NOT
« Reply #1 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))

JohnK

  • Administrator
  • Seagull
  • Posts: 10569
NULL & NOT
« Reply #2 on: October 23, 2003, 03:37:50 PM »
Cool.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org