This is inspired inpart by discussions I had on #perl6.
Basically what is the behavour of the hyperop when applied to two
hashes.  The concensus was that the hashes would get unrolled into
lists, and the pairs would get matched up more or less randomly.

        I don't feel that this is a usefull DWIMy behavour.  I think a
more usefull behavour is the following.  Pairs on both sides that have
common keys should have there values oped together and a hash
should be created from these.  The behavour would be something like
this (please forgive bugs).

multi sub infix_circumfix_meta_operator:{'>>','<<'} (Hash %a,Hash %b,Code $op) {
        my Hash %return;
        for intersection(keys %a,keys %b) -> $key {
          %return{$key} = $op($a{$key},$b{$key});
        }
        return %return;
}

        Would this be sensible, usefull behavour?

-- 
Please excuse my spelling as I suffer from agraphia. See
http://dformosa.zeta.org.au/~dformosa/Spelling.html to find out more.
Free the Memes.

Reply via email to