Le 18/06/2013 13:41, Frank Shearar a écrit :
On 18 June 2013 12:35, Goubier Thierry <thierry.goub...@cea.fr> wrote:
Le 18/06/2013 13:09, Esteban Lorenzano a écrit :
I do not like it :)
also, you already have #in:
which is more generic and allows simplifications:
<my complex expression> in: [ :blah |
blah = myTest
ifTrue: [ blah some ] ]
ifFalse: [ blah other ] ]
This is cool :) Didn't knew about this one.
It's a lot like `let` in other languages (Haskell, the Lisps, and so on).
Yes, of course, but I was nicely surprised to see it here :)
Could we use do: in the same way ? Because in: is in a way the same as
{<my complex expression>} do: [ :blah |
blah = myTest
ifTrue: [ blah some ]
ifFalse: [ blah other ] ]
With a different return value.
No: #do: signals that you're doing something entirely for a side
effect. But if you said `{<my complex expression} collect: [:blah |
...]` then I'd agree with you.
Yes. I'd even use`({<my complex expression>} collect: [:blah |
> ...]) first` just to be sure !
Thierry
--
Thierry Goubier
CEA list
Laboratoire des Fondations des Systèmes Temps Réel Embarqués
91191 Gif sur Yvette Cedex
France
Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95