Edit
Attach
Printable
topic end
<!-- * Set TOPICTITLE = #define private public - And... Action! (Part 3) --> <style type="text/css"> pre {background-color:#ffeecc;} </style> %STARTINCLUDE% <a name="19"></a> ---+++ [[DefinePrivatePublic20090919AndActionPart3][And... Action! (Part 3, 19 Sep 2009)]] <summary> In <a href="DefinePrivatePublic20090908AndActionPart2">part 2</a> of the series, I broke the news that so-called action routines (such as <tt>extrude</tt>) violate Common Lisp evaluation rules in <nop>CoCreate Modeling. Which should cause any Lisp aficionado out there to frown; after all, the evaluator is <a href="http://lib.store.yahoo.net/lib/paulgraham/jmc.lisp">central to any Lisp implementation</a>, and largely determines the nature of a Lisp system. There is a reason why the <a href="http://www.nhplace.com/kent/Papers/Technical-Issues.html">Lisp-1 vs. Lisp-2 debate</a> has been raging for decades! So why did <nop>CoCreate Modeling insurrect against the Common Lisp standard? Did we have an issue with authorities, did we want to stage a publicity stunt, or were we just a bunch of imbecile script kiddies who didn't know any better? </summary> Nothing of that kind. Instead, I put the blame on having too many users of a successful predecessor product :D Let me explain. In the 80s, our 2D CAD application [[http://de.wikipedia.org/wiki/ME10][ME10]] (now: !CoCreate Drafting) had become extremely popular in the mechanical engineering market. ME10's built-in macro language was a big success factor. Users and CAD administrators counted on it to configure their local installations, and partners wrote macro-based extensions to add new functionality - a software ecosystem evolved. A typical macro-language command looked like this: <img src="%ATTACHURLPATH%/line_rectangle.png" alt="LINE RECTANGLE 0,0 (PNT_XY FOO BAR) 42,0 0,42 END" /> Users didn't have to type in the full command, actually. They could start by typing in =LINE= and hitting the =ENTER= key. The command would prompt for more input and provide hints in the UI on what to do next, such as selecting the kind of line to be drawn, or picking points in the 2D viewport (the drawing canvas). The example above also illustrates that commands such as =LINE RECTANGLE= could loop, i.e. you could create an arbitrary amount of rectangles; hence the need to explicitly =END= the command. Essentially, each of the commands in ME10 was a domain-specific mini-language, interpreted by a simple state machine. The original architects of <nop>SolidDesigner (now known as <nop>CoCreate Modeling) chose Lisp as the new extension and customization language, but they also wanted to help users with migration to the new product. Note, however, how decidedly un-Lispy ME10's macro language actually was: 1 In Lisp, there is no way to enter just the first few parts of a "command"; users always have to provide all parameters of a function. 2 Lisp functions don't prompt. 3 Note the uncanny lack of parentheses in the macro example above. But then, we all know how malleable a language Lisp is. All of the problems above could be solved by a fairly simple extension with the following characteristics: * Define a special class of function symbols which represent commands (example: =extrude=). * Those special symbols are immediately evaluated anywhere they appear in the input, i.e. it doesn't matter whether they appear inside or outside of a form. This takes care of issue #3 above, as you no longer have to enclose =extrude= commands in parentheses. * Evaluation for the special symbols means: Run the function code associated with the symbol. Just like in ME10, this function code (which we christened _action routine_) implements a state machine prompting for and processing user input. This addresses issues #1 and #2. These days, you would probably use something like [[http://l1sp.org/cl/define-symbol-macro][define-symbol-macro]]. Back then, the Common Lisp standard had not been finalized and our Lisp implementation did not provide =define-symbol-macro= yet. And thus, <nop>CoCreate Modeling's Lisp evaluator extensions were born. <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.2 |
>
|
r1.1
|
Total page history
|
Backlinks
You are here:
Blog
>
DefinePrivatePublic20090919AndActionPart3
r1.2 - 19 Sep 2009 - 16:45 -
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