develooper Front page | perl.perl5.porters | Postings from July 2012

[perl #112538] Feature request - alternate syntax and features for smart matching - [?] {?}

From:
Jesse Luehrs via RT
Date:
July 2, 2012 21:05
Subject:
[perl #112538] Feature request - alternate syntax and features for smart matching - [?] {?}
Message ID:
rt-3.6.HEAD-28836-1341288334-1842.112538-15-0@perl.org
This already (basically) exists on CPAN, as Perl6::Junction.

  use Perl6::Junction 'any';
  if (any(@ARGV) eq '-w') { ... }
  if (any(@array1) eq any(@array2)) { ... }
  if (any(@array) eq any(@$arrayref)) { ... }
  if (any(values %hash) == 64) { ... }
  if (any(map { $_->{uid} } values %user) == 500) { ... }

I don't think that this really has anything to do with smart matching -
the syntax you propose seems more like the * (whatever) operator from
Perl 6. That is one of the features I think would be pretty awesome to
steal from them, but I don't really see that as being very likely to
happen anytime soon, barring someone showing up with a patch.

-doy


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=112538



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About