Code: Select all
newLISP v.10.2.1 on Win32 IPv4, execute 'newlisp -h' for more info.
> ; a sort of nested contexts
> (setq la '(((k0 v0) (k1 v1)) ((k2 v2) (k3 v3)) ((k4 v4) (k5 v5))))
(((k0 v0) (k1 v1)) ((k2 v2) (k3 v3)) ((k4 v4) (k5 v5)))
> ; we can search through them
> (dolist (x la) (println $idx ": " x ", " (assoc 'k3 x)))
0: ((k0 v0) (k1 v1)), nil
1: ((k2 v2) (k3 v3)), (k3 v3)
2: ((k4 v4) (k5 v5)), nil
nil
> ; but when we try to stop...
> (dolist (x la (assoc 'k3 x)) (println $idx ": " x))
0: ((k0 v0) (k1 v1))
?
> ; something weird already! If we try to save the result...
> (setq result (dolist (x la (assoc 'k3 x)) (println $idx ": " x)))
A bug in my code, or in newLISP?