Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^2: Perl6: Smartmatch scalar to array

by TimToady (Parson)
on Aug 16, 2010 at 20:14 UTC ( #855350=note: print w/ replies, xml ) Need Help??

in reply to Re: Perl6: Smartmatch scalar to array
in thread Perl6: Smartmatch scalar to array

Indeed, it is precisely because Perl 6 has junctions that we do not need to assume junctional semantics on smartmatched lists; Perl 5 does not have junctions, so it does assume that. Instead, Perl 6 can use a list to smartmatch another list, which is also a useful behavior--especially since wildcards are supported. For instance, (1,2,3,4,5) ~~ (*,2,3,*) returns true.

Comment on Re^2: Perl6: Smartmatch scalar to array
Download Code
Replies are listed 'Best First'.
Re^3: Perl6: Smartmatch scalar to array
by molecules (Monk) on Aug 18, 2010 at 17:36 UTC

    Thanks. I had assumed that smartmatch would be identical between Perl 5 and Perl 6, but I like the Perl 6 way better. It seems more maintainable.

    Also, thanks for all of your work on all of the Perls.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://855350]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2015-10-05 00:12 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (105 votes), past polls