Code Red > AutoLISP (Vanilla / Visual)
How to determine equality of nesting
Lee Mac:
--- Quote from: bruno_vdh on June 14, 2019, 04:40:01 AM ---
--- Quote ---_$ (foo '(1) '(1 . 1))
nil
--- End quote ---
If we consider this:
--- Code: ---_$ (car '(1.1))
1.1
_$ (car '(1))
1
_$ (cdr '(1.1))
nil
_$ (cdr '(1))
nil
--- End code ---
--- End quote ---
'(1 . 1) is very different to '(1.1) - the former represents a dotted pair, the latter a list containing a single item.
As such, the comparison would become:
--- Code - Auto/Visual Lisp: ---_$ (car '(1 . 1))1_$ (car '(1))1_$ (cdr '(1 . 1))1_$ (cdr '(1))nil
bruno_vdh:
Yes I was too fast in my conclusions, thanks for correcting my mistake
Navigation
[0] Message Index
[*] Previous page
Go to full version