Example A-SIGNATURES Re: A Way to express Standard multi-argument
Method Signatures in Smalltalk Re: [ANSI-Smalltalk] Next STEPs
Panu Logic
panulogic at gmail.com
Sun Mar 16 11:04:58 GMT 2008
Paolo Bonzini wrote:
>> *(nil <- true <- false <- #foo) = (OrderedCollection with:
>> nil with: true with: false with #foo) *.
> And what if I want to have an OrderedCollection or another kind of
> Collection as the first item?
I'm not proposing this as a replacement for what exists as de-facto
standards in Smalltalks, merely pointing out that there are succinct
alternatives to the literal Array-syntax, which sometimes may be
more convenient.
I assume that nobody here wants to standardize some new Array-syntax
that in general would allow both literal and evaluable components.
I'm saying that would be unnecessary, because we can use an idiom
like above.
In general I'm from the minimalist-syntax school. The thinner
the book of standard syntax, the better. Therefore I'm not
for the idea that "some elements of literal Arrays are treated
as Symbols, some as Booleans"> The standard will be smaller
if all elements of literal arrays are treated equally. What I've tried
to demonstrate is that there is no real good reason why we would
need to treat some elements of a literal Array specially, because
a similar effect can be achieved via the #<- -idiom.
Standard libraries on the other hand should contain everything
that helps us get the job done.
As to your question, if you want to create an OrderedCollection whose
first element is an OrderedCollection, you can say:
(OrderedCollection new <- true <- false <- #foo)
Again, this was only meant as an illustration that it is
possible to create Collections dynamically, without
succumbing to the verbose #with:with:with:with: -syntax,
and without devising any new syntactic constructs
above ST-80.
-Panu Viljamaa
>
>> POINT: Smalltalk (-standard) does not /need/ a syntax for creating
>> Arrays
>> with non-literal elements. Why? Because BINARY OPERATORS can be
>> utilized and redefined as needed to construct arbitrary data-structures.
>
> Funny, syntax extensions was one of the STEPs I had in mind. :-)
>
> Paolo
>
> _______________________________________________
> ANSI-Smalltalk mailing list
> ANSI-Smalltalk at lists.openskills.org
> http://lists.openskills.org/cgi-bin/mailman/listinfo/ansi-smalltalk
>
More information about the ANSI-Smalltalk
mailing list