[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Casual object churn and efficiency.
- From: Jamie Webb <j@...>
- Date: Mon, 28 Jun 2004 21:38:35 +0100
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
problem.
-- Jamie Webb