Damian Conway <[EMAIL PROTECTED]> writes:
> Incidentally, the table of C<=~> comparisons (Table 1) at:
>
> http://dev.perl.org/perl6/apocalypse/4
>
> suggests that hash/hash matching is equivalent to:
>
> match if grep exists $a{$_}, $b.keys
>
> I hope to convince Larry that it would be better if it were equivalent to:
>
> match if any($a.keys) =~ any($b.keys)
That certainly seems more 'smart matchy' (does that make sense?)
> so that each key is recursively C<=~>-matched against each key.
>
> I'd prefer that because if I hope to convince Larry to allow hash
> keys to be any scalar value (not just strings). That way the "keys
> as a set" idiom might actually be usable.
I thought he was already convinced of that one. And even if he's not,
setting up the smart match in the second form means less work when
someone does:
# Like a hash, but with arbitrary keys.
class Dictionary is HASH { ... }
Not that changing =~ would be that much work anyway...
--
Piers
"It is a truth universally acknowledged that a language in
possession of a rich syntax must be in need of a rewrite."
-- Jane Austen?