From: Franck A. <fr...@ne...> - 2008-08-14 15:39:38
|
> Are you going to remove "from" and "until" as well? it goes without saying. > How do you intend to implement {G}.do_all (where G is ARRAY, etc.)? do_all (a_agent: PROCEDURE[ANY, TUPLE[G]]) do (lower |..| upper).do_all (agent do_one (a_agent, ?)) end do_one (a_agent: PROCEDURE[ANY, TUPLE[G]; a_index: INTEGER) do a_agent.call ([item (a_index)]) end I feel you're going to ask how I implement INTEGER_INTERVAL.do_all, I'd use recursion, it would help if the compiler recognises it in some way so that the generated code does not use stack space, but it's the only place where you need a slight implementation-level cheat. as for loops which are open ended and not index-based, (1 |..| Maximum_integer).do_until should be OK, and again if all else fails you can always fallback on recursion but you shouldn't have to. I think all loops I have written in the past few years are either straightforward container loops or fit well within the Maximum_integer boundary. |