lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Monday 28 June 2004 20:43, Marius Gheorghe wrote:
> Jamie Webb Wrote:
> > As it is, it wouldn't work if you used the same function more
> > than once in an
> > expression.
> I actually beg to differ (provided we are not dealing with preemptive
> multithreading).

Try something like:

result = (v1 + v2) :cross (v3 + v4)

supposing your add function is bound to +. The expressions (v1 + v2) and (v3 + 
v4) must both be calculated before the cross product. But, using your 
function, those two results will both be stored in the same table, and so one 
will overwrite the other. There is no general fixed-space solution to this 

-- Jamie Webb