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: Stewart Stremler
Subject: Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax
Date: Wed, 14 Mar 2007 01:13:01 -0700
User-agent: Mutt/1.5.9i

quoting Paolo Bonzini as of Tue, Mar 13, 2007 at 12:54:13PM +0100:
> 
> > So perhaps
> > 
> >         (Object subclass: #MyClass)
> >                 comment: 'A simple example class'
> >         !
> > 
> > ...would be appropriate/reasonable behavior?
> > 
> > (The only really annoying thing is having to use parentheses.)
> 
> ... and still having to use the bang (or a class declaration
> inside an Eval) is not optimal.

Well, you could use a period, too, as you wouldn't need to refer
to MyClass if you used ; while defining the class.  I was thinking
of something like the following (but I trimmed it out as being
irrelevent):

   (Object subclass #MyClass)
           comment: 'A simple example class';
           addClassVar: 'foo';
           addInstanceVar: 'bar';
           addMethod: 'blah:' for: 'category' as: [ :anArg |
              | localvar |
              ...
           ];
           addClassMethod: 'qux:qux:' for: 'static funcs' as: [ :arg1 :arg2 |
              | more local var |
              ...
           ]
   .


...which lets me define classes a bit at a time without having to remember
the magic incantation.

-- 
I suspect I missed the point of the response.
Stewart Stremler




reply via email to

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