On Fri, Aug 18, 2000 at 09:31:44AM +0100, Hildo Biersma wrote:
> Ah, syntax - I have no idea.
Well, syntax aside, how would this work?
> One thing we could do, theoretically:
>
> %hash = ('James' => 'Gibbon',
> 'Dave' => 'Mallon',
> 'Pete' => 'Munro');
>
> while (my ($key, $value) = each alphabetic %hash) {
> ...
> }
Does the presence of an ordering subroutine cause perl to generate a
linked list of all the elements of the %hash in the proper sequence
prior to iteration (and somehow attach it to the iterator)? Seems
like everytime we did that it would generate a new operator:
while (my ($key, $value) = each alphabetic %hash) { # 1
while my ($k2,$v2) = each crazy_order %hash) { # 2
...
}
}
At #1, the iterator would really be an each_alphabetic and #2 would really
be an each_crazy_order rather than a generic iterator. (Unless you really
want the iterator to compute the next in sequence on each iteration)
-Scott
--
Jonathan Scott Duff
[EMAIL PROTECTED]