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

Re: LFM + LFSP = LFE?




This syntax looks decent.  One question: is it "just syntax" or can one
regard the block containing the method bodies as a message being sent to a
class?  Given my knowledge of ST syntax, I'd say it's the latter (no method
selector), and that will annoy the purists.  But then, I'm not a purist ;-)
This was one reason for my preferring curly braces: it's more easy to
rationalize it as "just syntax"; with square brackets you are overloading
the meaning of the block notation.

Mike

> Date: Sat, 14 Jun 2003 13:27:58 -0700 (PDT)
> From: Avi Bryant <avi@beta4.com>
> 
> 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
>