A guick example that can depict this point can be...
[:x| x sqrt ] value: ([:x| x + 5 ] value: ([:x| x * x ] value: 2))
An idea came up to me a few minutes ago,
Define a method for Object
------------------------------------------------------------------------------------
Object>>--> aBlock
^aBlock value: self
------------------------------------------------------------------------------------
This new method can transform the example expression to...
2 --> [:x| x * x ] --> [:x| x + 5 ] --> [:x| x sqrt ]
Have a good one
Howard
> [:x| x sqrt ] value: ([:x| x + 5 ] value: ([:x| x * x ] value: 2))
>
> This new method can transform the example expression to...
>
> 2 --> [:x| x * x ] --> [:x| x + 5 ] --> [:x| x sqrt ]
I like that. Very nice :)
-- chris
| x y z |
x := 2.
y := x * x.
z := y + 5.
z sqrt
or even:
| x |
x := 2.
x := x * x.
x := x + 5.
x sqrt
Cheers,
Wolfgang