[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LFM + LFSP = LFE?




On Fri, 13 Jun 2003, Michael Vanier wrote:

> > Do you have any syntax suggestions?
>
> I would like to see curly braces used to delimit method blocks, although ST
> usually uses them for arrays (sort of like lisp quasiquote IIRC), although
> this isn't used much.  Other than that, I'm pretty easy.  It's not a
> totally trivial problem.

Ok, I've hacked out a very, very rough system for writing scripts in
Squeak.  The syntax I use is this:

<expression evaluating to class> [
  <method header> [
     <method body>
  ]

  <method header> [
     <method body>
  ]

  ...
]

I've also added a Script class, which has stdout, stdin, and argv instance
variables.  It also defines #puts:.  An instance of this class is created
and sent #run at start up, so every script should redefine that method:

Script [
  run [
    self puts: 'hello world'
  ]
]

For convenience, I've also added some short versions of the class
creation messages, so you can do just

Object subclass: #Foo [...]

or

Object subclass: #Foo instanceVariableNames: 'x y z' [...]

rather than using the full
#subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:.

If anyone actually wants this beast, email me privately.

Cheers,
Avi