Re: RFC 57 (v1) Subroutine prototypes and parameters
[email protected] (Jacob Davies) Mon, 7 Aug 2000 13:51:55 -0700
| Newsgroups | perl.perl6.language.subs |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Aug 07, 2000 at 10:42:32PM +0200, Bart Lateur wrote: > On Tue, 8 Aug 2000 06:28:27 +1000 (EST), Damian Conway wrote: > No, seriously: unless you can read those variables as x or y, I wouldn't > drop the prefixes. It's not consistent. If you use the values as $x or > @t, then please, use $x and @t in the above syntax, as well. This doesn't make sense to me, because those are not variables that are currently in-scope. They're only in-scope inside the sub you're calling. And in fact if you require the prefixes, you're *continually* going to be writing code that looks like: foo( $name : $name, @addresses : @addresses, $email : $email ); because you're often going to name in-scope variables the same thing as the parameter names for the sub. I prefer: foo( name : $name, addresses : @addresses, email : $email ); even though I'd rather that: foo( name => $name, addresses => \@addresses, email => $email ); "just worked" somehow. Magical thinking, I know. -- Jacob Davies [email protected]