On Fri, 2006-12-22 at 19:49 -0800, Colin LeMahieu wrote:
> I'm trying to take a larger array, a(1,
> 12) and break it up in to smaller pieces b(1, 4) c(5, 8) d(9, 12) and
> send these pieces to other features for them to fill in.
A poor man's solution might involve a fake array using the triple
(reference to the original array, dope lower, dope upper).
The reference part could be passed once for an object or
as an additional routine parameter. This would be simulating
the possibility of having local routines a la
feature do_something(a: ARRAY[NATURAL_8]) is
local -- not Eiffel
feature compute_part(l: INTEGER; r: INTEGER) is
local loop_index
do
from loop_index := l until loop_index > r loop
use(a @[EMAIL PROTECTED]
loop_index)
end
end
do
compute_part(a.lower, mid_point)
compute_part(mid_point + 1, a.upper)
end
> -Pass a.subarray(1, 4) to a feature, have it return an array, and then
> copy the results back in with a.subcopy
> -Inherit from ARRAY and define my own "jointarray" feature such that
> the array returned points to a subregion of the memory of the original
> array.


|