[squeak-dev] Re: Renaming "Squeak"
Paolo Bonzini
bonzini at gnu.org
Thu May 15 07:42:38 UTC 2008
Jason Johnson wrote:
> On Wed, Mar 5, 2008 at 10:23 PM, David Mitchell
> <david.mitchell at gmail.com> wrote:
>> Brace notation for dynamic arrays!
>
> So instead of:
>
> dictionary := { $a -> 1. $b -> 2. $c -> 3 } asDictionary.
>
> I need to type:
>
> dictionary := Dictionary new
> add: $a -> 1;
> add: $b -> 2;
> add: $c -> 3;
> yourself.
>
> ? In my opinion the other dialects should adopt this or propose
> another way of doing it.
Interesting that, given yout three replies, we seem to disagree on
everything but the usefulness of the brace syntax! :-P
I'm also very much in favor of the brace syntax. Personally, I think a
lot in terms of "list of things to work on", and just seeing the list is
much simpler than having to parse a "Array with: a with: b with: c"
method. Granted, this is an extreme case but I mean, all I want to see
is a,b,c and yet I see 17 (out of 20) extraneous alphabetic characters.
Not to mention that brace syntax helps keeping methods short by making
some line breaks useless (e.g. in the previous example I'd write the
#with:with:with: call on 4 line!).
If you want to start interesting discussion on
ansi-smalltalk at lists.openskills.org (the
was-ANSI-Smalltalk-now-STEP-project mailing list), you could try your
hands at writing a specification for this extension, at
http://smalltalk.gnu.org/step/syntax-extensions-and-corrections-non-literal-array-creation
See also http://smalltalk.gnu.org/step/step-specification-and-workflow
for what is part of a STEP (Smalltalk Enhancement Proposal). In this
case you don't even need a reference implementation because Squeak and
GNU Smalltalk already implement the brace syntax, and VW has it in a
separate package (see also
http://www.cincomsmalltalk.com/publicRepository/BraceConstructor.html
for more info).
Paolo
More information about the Squeak-dev
mailing list
|