First post here ... few days on Squeak ... some questions ....
Fabio Filasieno
fabio.filasieno at gmail.com
Fri Aug 24 20:57:48 UTC 2007
II'm new at Smalltalk and I have a few questions.
"""Why smalltalk has no operator for piping ?""""
obj collect: [ :x | …] | filter: [:x | …] | select: [:x | …] ?
but has the `;` (cascade operator)?
I don’t care to send messages to the reciever of the previous
message, because I return self when no return value is important; for
instance ….
point x: 10 | y: 20 | z: 30
x returns self, y returns self, z returns self -> which is the
updated point.
works exactly as:
point x:10; y:20 ; z:30.
But you lose PIPES !!!!! Can somebody elaborate on this ?
There might be cases where I'm returning a value and I wish to
discard it and then send again to the previous receiver ... but I
really don't like to loose the pipe for that ... since I can do that
returning self.
With Smalltalk ... we've got a homoiconic language and the system
written in it self, a consistent language in everything, even the if-
then-else that everybody else still don't get right; we've got the
most wonderful programming experience of all, even better that Ruby/
Python etc ...
but why on earth we have the "cascade operator" instead of the
PIPE ?????
What I'm I missing ?
I need the `|` to avoid parenthesis, and weird hacks ...
Fabio
More information about the Squeak-dev
mailing list
|