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
Mon Mar 17 15:19:50 GMT 2008
Paolo Bonzini wrote:
>> What about adding 'self' and 'thisContext' also?
> This does not make sense at all. It wouldn't be a literal Array.
These cases differ syntactically very little from allowing false and
true and nil.
So it does make some sense at least to me that if you treat nil and
true and
false specially, you could also treat self specially.
>> (OrderedCollection new <- true <- false <- #foo)
> No, this cannot work, because by your definition you have
>
> Collection >> <-anObject
> self add: anObject
I don't think I gave the above definition anywhere (did I?).
It's not my definition. The definition I had in mind was
Object >> <- anObject
^ OrderedCollection new add: self; add: anObject; yourself
In other words the first element of the result of
OrderedCollection new <- true <- false <- #foo
would be an OrderedCollection whose 1st element is an OrderedCollection.
So yes it can work.
One-element dynamic Collections were never the problem - simply use
#with:.
The above idiom is meant to help creation of arbitrary-length dynamic
collections.
> .... and what about one-element collections? Defining new language
> elements is hard.
As I already said, this is not about defining new elements, but rather
to show
how we can avoid having to create new language elements and rules (treat
the tokens true,. false, and nil specially inside literal Arrays) , by using
appropriate patterns and idioms.
> The worst that could happen to this project, is to have extremely long
> threads with no conclusion as on the Squeak list.
>
> And that's also why the STEPs are meant to categorize their own
> discussion. I think one-catches-all discussions like this one should
> be avoided actually.
I agree we're probably wasting the bandwidth on this. I just wanted
to put in
the above corrections, lest I give the impression that I agree. So,
I'm going to
drop this subject on this list now, unless something very interesting
comes up.
You are welcome to have the last word on the topic, if you wish to.
-Panu Viljamaa
More information about the ANSI-Smalltalk
mailing list