PackageDescription: ScriptingSupport


Scripting Support

Last published: January 25, 2008 by 'bobw'

Defines 4 Classes
Extends 12 Classes


This adds support for scripting using the image. The basic thing it defines is a subsystem that will look for script arguments or a script file name. Typical usage is something like
visual scripting.im scriptfile.st
on Windows, you need to use the console engine, so, e.g. from the image directory
..\bin\win\vwntconsole.exe scripting.im scriptfile.st

For a complete list of options, use the -h command-line argument. For an interactive shell, use -i.

To run this from a plain starting image, you can use, e.g.
visual visual.im -nogui -pcl "Scripting Support"

In addition to allowing code to be run, this contains a few experimental things to make scripting easier. The first of those is the & operator. This is something to make building up collections easier. You get tired of doing
aCollection, (Array with: aThing)
even in the normal image. In scripts it''s even worse. So you can do
aCollection & aThing
and even
aThing & anotherThing
(unless aThing is a boolean). That exception is a little odd, but we liked the semantics of & as a selector for that purpose well enough that we thought it was worthwhile.