newLISP Fan Club

Forum => newLISP newS => Topic started by: Kazimir Majorinc on October 09, 2008, 07:44:34 AM

Title: Bug report: local & setq, 9.9.6, Windows
Post by: Kazimir Majorinc on October 09, 2008, 07:44:34 AM
(set 'f (lambda ()
           (local (e)
                  (setq e (map eval (args)))
                  (println "Disco! " (string? nil) "! Punk!"))))


(f "Rock'n'roll"); Disco! ("Rock'n'roll")! Punk!
Title:
Post by: Lutz on October 09, 2008, 09:52:12 AM
It's changing the value of nil when applying setf/setq on un-initialized locals defined using 'local'. This is fixed in 9.9.7. Thanks for catching this.



as a workaround use 'let' instead of 'local':


(set 'f (lambda ()
     (let (e)
           (setq e (map eval (args)))
           (println "Disco! " (string? nil) "! Punk!"))))

(f "Rock'n'roll") => Disco! nil! Punk!