21st Century Smalltalk

April 23, 2007

Application Launcher Added

Filed under: Adobe, Apollo, Lisp, Smalltalk Language — pfisk @ 6:27 pm

classbrowser3
Vista Smalltalk Site

Open Vista Smalltalk in your browser.

I have added an application launcher which appears in the Vst/Flash application window on startup. All startup actions are determined by the scripts in config.lisp, so this required simply adding a line of code.

Below is the code for the “run” method which illustrates some of the dynamic capabilities of the interpreter:

  • the @selectedItem message returns the selected tree item
  • the @property- message returns the name of the item as a string
  • the @intern message sent to the string returns a symbol
  • the @eval message returns the value of the symbol
  • the @or-, @isDemoClass, @isToolClass messages determine if the value is an appropriate class (for example, you shouldn’t try to run “Demos”)
  • if it is an appropriate class, send it the “open” message to start the demo or tool

(add-method Launcher 'run
  (lambda()
  (let ((cls)(item))
  (setq item (@selectedItem (@self 'treepane)))
  (setq cls (@eval (@intern (@property- item 'label))))
  (cond ((@and- item (@or- (@isDemoClass cls) (@isToolClass cls)))
         (@perform 'open cls))))))

The concepts in this style of programming come from Smalltalk but, for the moment, the syntax is Lisp. Once the Smalltalk-Lisp conversions are more robust, most of the “high level” application code will be done with Smalltalk syntax.

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.