help-smalltalk
[Top][All Lists]
Advanced

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

Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax
Date: Sun, 11 Mar 2007 20:30:35 +0100
User-agent: Thunderbird 1.5.0.10 (Macintosh/20070221)

> If I interpret the syntax correctly, #class is expected to be sent last,
> which is completely contrary to the normal rules of precedence. In this
> situation, I think it would be far better to abandon the pretense that
> these are message sends.

No, it's probably the "name:" that is misleading, it should probably
be something like "ref:" but I didn't fully like that, either.  It just
means, take whatever comes next as the scope for the method definitions.

Consider that "Class name: RandomInteger class." would be a message
send, while "Class name: RandomInteger class [" would be a "scope
definition" so to speak.  Having two different parse trees for the
bits up to "class" would be a complete mess.

> Couldn't you simply write:
> 
> SomeClass [
>       ...
> ]
> 
> or have I misunderstood?

Yes, but it would lose much in flexibility and future extensibility.

While not exemplified by the
snippets I sent, there are other 'something [ something ]' syntaxes
that are planned, including "Eval [ 3 printNl ]" and
"Namespace name: SomeNS [ 3 printNl ]" (3 printNl could also be
a class definition).  The latter could also be "Namespace current:
SomeNS [ ... ]", it's not decided yet...

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]