in reply to Default subroutine parameters

my preferred method is my $foo = shift // 'default';

alas, this method won't be available until perl 6 :(

see Exegesis 3 for more details (there's a summary on page 7.)

~Particle ;Þ

Replies are listed 'Best First'.
Re: Re: Default subroutine parameters
by BrentDax (Hermit) on Apr 22, 2002 at 21:03 UTC
    I submitted a patch last night to p5p that implements //, but it's too late to make it into 5.8. However, everyone thinks it's really cool, so there's a very good chance it'll be in 5.10. (One person suggested that we fork off 5.9 right now so the patch would apply, but everyone else (including me) thinks that it'd be more trouble than it's worth to keep it in sync with the 5.8 release candidates, which should start coming out Real Soon Now.)

    Needless to say, I'm happy--it's the first time I've ever patched the core and they're already excited. :^) I thought I'd get a few "oh, that's cool"s, some style critiques, and enough experience to confidently patch the core--not the first feature for the next version of the language.

    =cut
    --Brent Dax
    There is no sig.

      congrats, BrentDax. that is *very* cool.

      ~Particle ;Þ