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 b
Peter Scott asked:
> Why give up the chance to let things that look different behave differently?
Because then you'd have to remember which order did what.
Forcing you to actually think and remember is very unDWIMical. ;-)
> What do [the following do]?
>
> @left =~ @right
Array int
At 10:34 AM 4/7/02 +1000, Damian Conway wrote:
> > It's very cool--but why is it $key =~ %hash but $value =~ @array rather
> > than one way or the other?
>
>Because it's *both* ways. Perl 6's C<=~> operator is reversible.
>
>So you can write:
>
> $key =~ %hash
>
>or:
>
> %hash =~ $
John A asked:
> > This new turbo-charged 'smart match' operator will also work on arrays,
> > hashes, and lists:
> It's very cool--but why is it $key =~ %hash but $value =~ @array rather
> than one way or the other?
Because it's *both* ways. Perl 6's C<=~> operator is reversible.
So you can
On Fri, 5 Apr 2002 [EMAIL PROTECTED] wrote:
> Does one of these items not belong?
>
> >From Exegesis 4:
>
> This new turbo-charged 'smart match' operator will also work on arrays, hashes and
>lists:
>
>
> if @array =~ $elem {...}# true if @array contains $elem
>
> if $ke
Does one of these items not belong?
>From Exegesis 4:
This new turbo-charged 'smart match' operator will also work on arrays, hashes and
lists:
if @array =~ $elem {...}# true if @array contains $elem
if $key =~ %hash {...} # true if %hash{$key}
if $value