Global variable in LISP & MDI

I have found a serious problem in using of global variables in LISP. It is case of AutoCAD compatibility violation. You can test next sample:1) In current drawing (e.g. drawing1) type :(setq gv “dr1”)(print gv)returned “dr1” . It is OK2) Create new drawing (e.g. drawin2). You can test varible “gv” by typing(print gv)returned nil. It is OK, because LISP works in separated namespaces, isn’t it.3) Now you can set “gv” in this drawing(setq gv “dr2”) (print gv)returned „dr2“It is OK still.4) Make current drawing1 and test(print gv)returned “dr2” !!!It is bug, isn’t it?Does somebody know how to solve this problem?

Comments

  • Until they fix the bug, I suggest that you have to set to nil any variable you use in a Lisp routine.

This discussion has been closed.