On Fri, May 17, 2002 at 05:40:30PM -0600, Luke Palmer wrote: > Back to from where this arose, however, I think LAST (and BETWEEN, if > it will exist) should probably be PRE blocks. This is the only way it > could be consistently possible to implement. It wouldn't make any > sense to have it a PRE block on a while and a NEXT block on a foreach.
C<LAST> can't be a C<PRE> block, for the same reason "else" couldn't be a NAMED block. A C<PRE> fires just after execution enters the current iteration's block. You're expecting C<LAST> to fire in the block just after the final iteration, but there is no block after the final iteration. On C<BETWEEN>, I think we're all agreed that it should fire after the final statement in one iteration and before the first statement in the next iteration (if we get it at all). If you boil down the discussion to it's barest essentials, the only thing at question is what values the variables in the C<BETWEEN> block should have when it fires. The values of the previous iteration or the following iteration? The debate about look-aheads for arrays and array-like objects is a red herring (though it's been interesting). It isn't necessary for either option. Allison