Edit
Attach
Printable
topic end
<!-- * Set TOPICTITLE = #define private public - And... Action! (Part 2) --> <style type="text/css"> pre {background-color:#ffeecc;} </style> %STARTINCLUDE% <a name="08"></a> ---+++ [[DefinePrivatePublic20090908AndActionPart2][And... Action! (Part 2, 08 Sep 2009)]] <summary> You may have guessed it: The whole <tt>set_pers_context</tt> business in the <a href="DefinePrivatePublic20090831AndAction">first part</a> of this mini-series was actually a red herring. I promise I won't mislead you this time - and I'll even reveal the reason why the series is titled "And...Action!" </summary> <img src="%PUBURL%/Blog/DefinePrivatePublic20090831AndAction/extrude.png" style="float:right;" /> No, we don't need contrived constructs like <tt> (print extrude)</tt> to show that =extrude= is somehow... different from all the other kids. All we need is a simple experiment. First, enter =extrude= in <nop>CoCreate Modeling's user input line: The <tt>Extrude</tt> dialog unfolds in all its glory, and patiently awaits your input. Now try the same with =print=: All you get is an uncooperative <i>"Lisp error: The variable PRINT is unbound"</i>. How disappointing. But then, the behavior for =print= is expected, considering the usual [[http://www.psg.com/~dlamkins/sl/chapter03-02.html][evaluation rules]] for Common Lisp, particularly for symbols. As a quick reminder: * If the symbol refers to a variable, the value of the variable is returned. * If the symbol refers to a function and occurs in the first position of a list, the function is executed. =extrude= & friends belong to the symbol jet-set in <nop>CoCreate Modeling. For them, the usual evaluation rules for functions don't apply (pun intended). Using [[http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node108.html][symbol properties]] as markers, they carry a backstage pass and can party anywhere. For members of the =extrude= posse, it doesn't really matter if you use them as an atom, in the first position of a list, or anywhere else: In all cases, the function which they refer to will be executed right away - by virtue of an extension to the evaluator which is unique to <nop>CoCreate Modeling's implementation of Common Lisp. You can create such upper-class symbols yourself - using a macro called =defaction=. This macro is also unique to <nop>CoCreate Modeling. Functions defined by =defaction= are called, you guessed it, <i>action routines</i>. But why, you ask, would I want such a feature, particularly if I know that it breaks with established conventions for Lisp evaluation? Well, precisely _because_ this feature breaks with the established rules. [[DefinePrivatePublic20090919AndActionPart3][<i>To be continued...</i>]] --- %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.3 |
>
|
r1.2
|
>
|
r1.1
|
Total page history
|
Backlinks
You are here:
Blog
>
DefinePrivatePublic20090908AndActionPart2
r1.3 - 15 Jul 2010 - 06:50 -
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