Re: Naming the method form of s///

2006-08-31 Thread Michael Snoyman
$foo.subst(:g, /bar/, baz) i seem to recall $foo.subst(/:g bar/, baz) is valid syntax already. If I'm not mistaken, the aversion to that syntax- as implied earlier in this thread- was that the :g is really a modifier on the substitution, not on the matching. (Please correct me

Re: Same-named arguments

2006-08-27 Thread Michael Snoyman
Mostly, it's that func('x' = 1) requires a bit too much typing, and also makes it hard for func() to change its signature later on to accept things other than Code. I was discussing this with a friend of mine (Eric Livak), and he suggested making the sigil on the name optional for

Same-named arguments

2006-08-25 Thread Michael Snoyman
I asked this same question on perl6-users, but no one really seemed to have a definitive answer, so please forgive me for reasking. I was wondering how named arguments would work when parameters of different types had the same name, ie sub foo($bar, @bar, bar) {...}. I wrote a little script to

Re: Pair of lists = list of pairs?

2006-08-23 Thread Michael Snoyman
: my %h; : [EMAIL PROTECTED] = @v; : : But is there an easy way in Perl6 to do it all in one go? Should this work? : : my %h = @k [=] @v; Reduce operators only turn infix into list operators. What you really want here is a hyper-fatarrow: my %h = @k »=« @v; Gaal pointed out using zip.