On 7/3/2012 11:02 AM, Jesse Luehrs wrote: > On Tue, Jul 03, 2012 at 01:58:45PM -0400, Eric Brine wrote: >> On Tue, Jul 3, 2012 at 4:59 AM, Ed Avis <eda@waniasset.com> wrote: >> >>> As in Python, 'in' could work for both arrays and hashes: >>> >>> $x in @array >>> >>> $x in %hash # same as exists $hash{$x} >>> >> So C<< $x in @array >> checks the values, and C<< $x in %hash >> checks the >> keys? Isn't that confusing? > This sort of thing is why I never liked the smartmatch behavior for > arrays and hashes either. It picks one arbitrary interpretation, and > blesses it with special syntax. Being explicit about what you mean (via > something like Smart::Match or Perl6::Junction) is a much much better > idea. In fairness, that description matches *all* language design, especially Perl's.Thread Previous | Thread Next