The other day, I spent some time debugging a surprising issue in Lisp code written
for CoCreate Modeling. Turns out that the problem can be shrunk down to
only a few lines, and is actually quite instructive on how Lisp's packages work -
an ideal candidate for this blog!
So here is the innocent-looking code:
(defun test()
(test_dialog))
(in-package :clausbrod.de)
(use-package :oli)
(sd-defdialog 'test_dialog
:ok-action '(display "test_dialog"))
Copy/paste this code into a file called
test.lsp
, then load the
file
into a fresh instance of CoCreate Modeling. Run the
test
function by entering
(test)
in
the user input line. Can you guess what happens now? Can you explain it?
To be continued...
to top