Edit
Attach
Printable
topic end
<!-- * Set TOPICTITLE = #define private public - A Package Riddle, part II (20 Aug 2009) --> <style type="text/css"> pre {background-color:#ffeecc;} </style> %STARTINCLUDE% <a name="20"></a> ---+++ [[DefinePrivatePublic20090820PackageRiddlePart2][A package riddle, part II]] (20 Aug 2009) <summary> Yesterday, I <a href="DefinePrivatePublic20090819PackageRiddle">presented some Lisp code</a> which puzzled me for a little while. </summary> To recap, here's the test code again: <pre> (defun test() (test_dialog)) (in-package :clausbrod.de) (use-package :oli) (sd-defdialog 'test_dialog :ok-action '(display "test_dialog")) </pre> Here is what happens if you save this code into a file, then load the file into <nop>CoCreate Modeling and call the =(test)= function: <img src="%ATTACHURLPATH%/testdialog.png" alt="testdialog.png" width="321" height="134" style="float:center;" /> <br clear="all" /> <i>"The function #:TEST_DIALOG is undefined"</i>? Let's review the code so that you can understand why I found this behavior surprising. First, you'll notice that the function =test= is defined in the default Lisp package. _After_ its definition, we switch into a different package (=clausbrod.de=), in which we then define a <nop>CoCreate Modeling dialog called =test_dialog=. The =(test)= function attempts to call that dialog. If you've had any exposure with other implementations of Lisp before, I'm sure you will say: "Well, _of course_ the system will complain that =TEST_DIALOG= is undefined! After all, you define it in package =clausbrod.de=, but call it from the default package (where =test= is defined). This is trivial! Go read [[http://www.flownet.com/gat/packages.pdf][The Complete Idiot's Guide to Common Lisp Packages]] instead of wasting our time!" To which I'd reply that =sd-defdialog=, for practical reasons I may go into in a future blog post, actually makes dialogs visible in <nop>CoCreate Modeling's default package. And since the function =test= is defined in the default package, it should therefore have access to a symbol called =test_dialog=, and there shouldn't be any error messages, right? [[DefinePrivatePublic20090822PackageRiddlePart3][To be continued...]] --- %STOPINCLUDE% %COMMENT{type="below" nonotify="on"}% ---
to top
End of topic
Skip to action links
|
Back to top
Edit
|
Attach image or document
|
Printable version
|
Raw text
|
Refresh
|
More topic actions
Revisions: | r1.2 |
>
|
r1.1
|
Total page history
|
Backlinks
You are here:
Blog
>
DefinePrivatePublic20090820PackageRiddlePart2
r1.2 - 22 Aug 2009 - 09:58 -
ClausBrod
to top
Blog
This site
2017
:
12
-
11
-
10
2016
:
10
-
7
-
3
2015
:
11
-
10
-
9
-
4
-
1
2014
:
5
2013
:
9
-
8
-
7
-
6
-
5
2012
:
2
-
10
2011
:
1
-
8
-
9
-
10
-
12
2010
:
11
-
10
-
9
-
4
2009
:
11
-
9
-
8
-
7
-
6
-
5
-
4
-
3
2008
:
5
-
4
-
3
-
1
2007:
12
-
8
-
7
-
6
-
5
-
4
-
3
-
1
2006:
4
-
3
-
2
-
1
2005:
12
-
6
-
5
-
4
2004:
12
-
11
-
10
C++
CoCreate Modeling
COM & .NET
Java
Mac
Lisp
OpenSource
Scripting
Windows
Stuff
Changes
Index
Search
Maintenance
Impressum
Datenschutzerklärung
Home
Webs
Atari
Blog
Claus
CoCreateModeling
Klassentreffen
Main
Sandbox
Sommelier
TWiki
Xplm
Jump:
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback