| From | Sent On | Attachments |
|---|---|---|
| Ricardo Signes | Jul 6, 2011 2:24 pm | |
| Leon Timmermans | Jul 6, 2011 3:19 pm | |
| Zefram | Jul 6, 2011 3:25 pm | |
| Reverend Chip | Jul 6, 2011 3:31 pm | |
| Zefram | Jul 6, 2011 3:49 pm | |
| Reverend Chip | Jul 6, 2011 3:53 pm | |
| Ricardo Signes | Jul 6, 2011 4:14 pm | |
| Zefram | Jul 6, 2011 4:30 pm | |
| Ricardo Signes | Jul 6, 2011 4:36 pm | |
| Reverend Chip | Jul 6, 2011 7:05 pm | |
| Ed Avis | Jul 7, 2011 9:15 am | |
| Jesse Luehrs | Jul 7, 2011 9:19 am | |
| Ed Avis | Jul 7, 2011 9:27 am | |
| Reverend Chip | Jul 7, 2011 9:33 am | |
| Ricardo Signes | Jul 7, 2011 9:43 am | |
| Zefram | Jul 7, 2011 9:43 am | |
| Reverend Chip | Jul 7, 2011 9:50 am | |
| Salvador Fandino | Jul 7, 2011 10:42 am | |
| Ricardo Signes | Jul 7, 2011 11:56 am | |
| Reverend Chip | Jul 7, 2011 12:29 pm | |
| Ricardo Signes | Jul 7, 2011 1:02 pm | |
| Reverend Chip | Jul 7, 2011 1:15 pm | |
| Randal L. Schwartz | Jul 10, 2011 3:42 pm | |
| Yuval Kogman | Jul 16, 2011 8:13 am |
| Subject: | Re: fixing ~~ harder. a lot harder | |
|---|---|---|
| From: | Yuval Kogman (noth...@woobling.org) | |
| Date: | Jul 16, 2011 8:13:04 am | |
| List: | org.perl.perl5-porters | |
There is another benefit.
A perfectly reasonable huffmanization candidate is srtuctural matching of data tuples/records, to borrow terminology from fp languages. For example [1, 2] ~~[qr/^\d w+$/, match { $_ < 3 }] or matching every hash value on the rhs side with the respectively keyed value in the lhs hash.
Since so many reasonable semantics exist I think it's best to err on minimalisms side and require explicit matchers for all scenarios and to disallow plain refs or arrays/hashes on the rhs On Jul 7, 2011 7:28 PM, "Ed Avis" <ed...@waniasset.com> wrote:
Jesse Luehrs <doy <at> tozt.net> writes:
use Smart::Match 'any'; my @a = (1, 2, 3); my $x = 2; if ($x ~~ any(@a)) { ... }
I currently write
if ($x ~~ @a)
but that would stop working under the 'dumb match' proposal. However, you are saying that because 'dumb match' will still accept a subroutine ref on the RHS, Smart::Match::any(@a) would continue to work.
That would work fine, as long as the Smart::Match module itself is not made obsolete by the proposed change. But still, on the principle that easy things should be easy, the Smart::Match module would need to be part of core so that perl out of the box has an easy and obvious way to test membership of a scalar in an array.
-- Ed Avis <ed...@waniasset.com>





