in reply to Re: Re: An Exegesis 4 thought
in thread An Exegesis 4 thought

I wonder why @_ in subs would still be needed. IIRC, you can write:

sub foo ($bar //= "some default", $bar //= "blah") { ... }

U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk

Replies are listed 'Best First'.
Re: An Exegesis 4 thought
by Anonymous Monk on Apr 08, 2002 at 18:07 UTC
    Oh I agree, but it seems the issue here is Perl 5 backwards compatibility.
Re: Re: Re: Re: An Exegesis 4 thought
by pdcawley (Hermit) on Apr 08, 2002 at 21:31 UTC
    Ah. That one's easy. Consider the following snippet of Perl 5 code:
    sub foo { my $bar = shift; my %baz = @_; ... }
    If you get rid of @_ and the defaulting behaviour of shift/pop et al how do you do a programmatic conversion to Perl 6?

    Of course, once you've got it autoconverted to perl 6 you'd go through and change it to

    sub foo($bar, %baz) { ... }
    But having running code which you can test is important.