Comments
Loading Dream Comments...
You must be logged in to write a comment - Log In
Now that function calls all require parameters (for readability) so we would have no way of expressing Niladic calls (as in Pascal's "Writeln;"). Also we need a Macro facility so we can write arbitrary text commands such as "Light brand in fire" or "Add A, B giving C". We achieve both these goals by use of ::SHE+ILA:: Macros. Just as functions are declared with "{...}", loops with "{*....*}", threads with "{!...!}", and event handlers with "{?...?}", we declare Macros with "{+...+}".
For example, woo <:: {+ % =>> a =>> b =>> c; c; b; a +};
extracts the next three tokens from the source line and swaps them round, so
woo three two one
would be the same as writing
one two three
We can also put them back in the source line using the insert operator, for example
squish <:: {+ % =>> a << ttyout ("hello") << a +};
inserts the text "ttyout("hello")" as if it had been typed by the user, when it sees the Macro "squish wooee" in the source stream. (Giving "ttyout ("hello") wooee). Note that you can easily write nonsense code :) Macros allow emulation of other languages and command structures, and more readable code. The command interpreter of ::SHE+ILA:: (i.e ::ILA::) may well be written as a set of macros, to allow compilation with MS Visual Studio or Borland C++ for example.