> I basically want to be able to automatically reduce the number of temps for 
> the following example to one:
>
> | t1 t2 |
> t1 := o1 foo.
> o2 bar: t1.
> o3 bar: t1.
>
> t2 := o1 foo.
> o2 bar: t2.
> o3 bar: t2.
>
> Of course it is slightly more complex than that, because the usage of the 
> temps is not just in a sequence, but can be also in blocks, or nested 
> expressions.
>
> But in this simple example, I could remove t2 and use t1 instead.

No, "o1 foo", "o2 bar: t1", "o3 bar: t1" could have side-effects that
influence what "o1 foo" returns. No tool on the world (without
additional knowledge) can safely replace "t2" with "t1".

Lukas

-- 
Lukas Renggli
www.lukas-renggli.ch

Reply via email to