Re: Same-named arguments

2006-08-27 Thread Mark J. Reed
On 8/26/06, Audrey Tang <[EMAIL PROTECTED]> wrote: 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. Allow me to make an immodest proposal. Have named parameter passing look lik

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 disambigua

Re: Same-named arguments

2006-08-26 Thread markjreed
So what's the rationale behind the latest changes? I thought p6 consistently regarded the sigil as part of the name; seems like that should go for named parameters, too. In fact, sigils would seem to be a good way to distinguish named parameters from pairs. Alternatively, reserve either :k(v) or

Re: Same-named arguments

2006-08-26 Thread markjreed
So what's the rationale behind the latest changes? I thought p6 consistently regarded the sigil as part of the name; seems like that should go for named parameters, too. In fact, sigils would seem to be a good way to distinguish named parameters from pairs. Alternatively, reserve either :k(v) or

Re: Same-named arguments

2006-08-26 Thread Audrey Tang
2006/8/26, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: So what's the rationale behind the latest changes? I thought p6 consistently regarded the sigil as part of the name; seems like that should go for named parameters, too. In fact, sigils would seem to be a good way to distinguish named parameters

Re: Same-named arguments

2006-08-25 Thread markjreed
So what's the rationale behind the latest changes? I thought p6 consistently regarded the sigil as part of the name; seems like that should go for named parameters, too. In fact, sigils would seem to be a good way to distinguish named parameters from pairs. Alternatively, reserve either :k(v) or

Re: Same-named arguments

2006-08-25 Thread Luke Palmer
On 8/25/06, Michael Snoyman <[EMAIL PROTECTED]> wrote: 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 f

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: Same-named arguments

2006-08-23 Thread Juerd
Carl Mäsak skribis 2006-08-23 21:54 (+0200): > Juerd (>), Michael Snoyman (>>): > >> sub mysub($foo, @foo, %foo) { > >I hope this is a compile time failure. If not, I'd expect a warning, at > >least. > Why? It looks reasonable IMHO. Because arguments are passed without sigil, and here you'd be for

Re: Same-named arguments

2006-08-23 Thread Carl Mäsak
Juerd (>), Michael Snoyman (>>): > sub mysub($foo, @foo, %foo) { I hope this is a compile time failure. If not, I'd expect a warning, at least. Why? It looks reasonable IMHO. // Carl

Re: Same-named arguments

2006-08-23 Thread Juerd
Michael Snoyman skribis 2006-08-23 12:10 (-0700): > sub mysub($foo, @foo, %foo) { I hope this is a compile time failure. If not, I'd expect a warning, at least. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.

Same-named arguments

2006-08-23 Thread Michael Snoyman
Hi, I'm just starting with Perl 6. I was reading through "Perl 6 and Parrot Essentials" (finally arrived yesterday from Amazon; very happy) and I was wondering what would happen if you had a parameter list that included variables of a different type but the same name (ie, $foo, @foo). I wrote a