Some Self ideas

Diego Gomez Deck DiegoGomezDeck at ConsultAr.com
Thu Jan 18 02:00:07 UTC 2001


I think that Squeak can include two messages (like Self) in Object that
can be very usefull.

One is:

Object>>value
    ^ self

In these way, all objects become polymorphic with blocks, so we can
type:

someVar := someCondition ifTrue:1 ifFalse:2.

instead of

someVar := someCondition ifTrue:[1] ifFalse:[2].

Actually the Squeak compiler does not permit other parameters than a
Block in these expression


The other message is:

Object>>, anObject
	^ OrderedCollection with:self with:anObject


aCollection := 1, 2, 3

just like Exception and ExceptionSet...

I think that the last is less powerfull because of curly braces...

TIA,

Diego Gomez Deck
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DiegoGomezDeck.vcf
Type: text/x-vcard
Size: 258 bytes
Desc: Card for Diego Gomez Deck
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010117/f4a73b09/DiegoGomezDeck.vcf


More information about the Squeak-dev mailing list