Damian Conway wrote:

> Actually, no I wouldn't.
> I'd be happier if it were more explicit.
> 
> How about:
> 
>         keys %professors = ^a->name cmp ^b->name;
> 
>         keys %students = $$students{^1}{GPA} <=> $$students{^0}{GPA} };
> 
> ;-)
> 
> Damian

Okay, let's see what you've got here, keys as an lvalue against
an expression involving hatted variables.

What about keys as an lvalue causing all named keys to exist? That
is what I would mean with keys as an lvalue.


The reason it is better than a tie, is because this way you can
do it to a hash that is already tied to something else.  Which you
can certainly do with a tie argument now, but it would be easy
to get wrong.




How about

        %professors{ sort $a->tenure <=> $b->tenure }


that way, the space is open for other special keywords to
appear at the beginning of the with-blocks, if we want some.


        %fields = &load_a_row;
        %fields{        # equivalent of with fields in Delphi or VB

                ${^age} < ${^shoesize} and print "${^name} is too young\n";

        };

Exact syntax open to debate



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

Reply via email to