List Info

Thread: Re: Smalltalk scripting syntax)




Re: Smalltalk scripting syntax)
country flaguser name
Latvia
2007-03-19 09:29:33
Paolo Bonzini wrote:
> So you would be in favor of something like
> 
>     Object subclass: #Boolean.
>     Boolean instanceVariableNames: 'blah blah'.
>     Boolean poolDictionaries: 'ImportSomeNamespace'.
> 
>     Boolean methods [
>         isIdentity [ <category: 'testing'> ^true
]
>         isImmediate [ <category: 'testing'> ^true
]
>     ].
> 
> etc.?  I'm pretty sure something like this will be
available "for
> free" once GNU Smalltalk's new syntax is
available.

Yes, that's what I'd prefer, for the most part. 
"Boolean methods [" or
something to that extent is fine, but I'm not happy about
further use of
brackets.  My complaint is that they reduce readability and
are a pain
to manage.  As far as I understand a method definition is
introduced by
a message pattern and terminated either by some special
character or a
new message pattern.  This is where I can see exclamation
point being
used, the same way it's currently used after #methodsFor: to
terminate a
method definition.  And as far as visual indication of where
a method
definitions starts and ends is concerned, indentation does
the same job
without getting in the way.  (Because most of the time you'd
use
indentation anyway.)  So those definitions would look like:

    Boolean methods [
        isIdentity
            ^true!

        isImmediate
            ^true!
    ]

Or on a single line if you prefer.  I'm still not happy
about <category:
''> and family either, but I suppose I can live with
that.

>>> As far as scripting, your suggestions will not
be implemented immediately
>>> due to lack of time, but they are a
prerequisite for the next release.
>> Heh.  I do not expect anyone to immediately jump in
on implementing them
>> and I'm entirely aware that they might not ever get
implemented.  No
>> problem there.
> 
> I meant to say that you *can* expect them to be
implemented. 
> In fact, I consider your contribution to this thread to
have been
> extremely useful and constructive.

Oh, that's good to read.  And thanks!

Best,
Jānis


_______________________________________________
help-smalltalk mailing list
help-smalltalkgnu.org

http://lists.gnu.org/mailman/listinfo/help-smalltalk

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )