Jonathan Scott Duff wrote:

> 
> 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]



The idea about sort-order is really about attributes on container objects,
and how to set them.

This C<each {comparator} %hash> syntax looks like a macro that would
expand (has anyone written a macro expansion RFC? It could become part
of my forthcoming RFC on having the parsing done entirely in terms
of catching syntax exceptions) each-comparator-%hash into


        (lazy map {($_, $hash{$_})} sort compartor keys %hash)

and extend "lazy" to mean, shift of as many as needed to fill the
lvalue.


Whew.


-- 
                          David Nicol 816.235.1187 [EMAIL PROTECTED]
                      Does despair.com sell a discordian calendar?

Reply via email to