develooper Front page | perl.perl6.language | Postings from August 2001

Expunge implicit @_ passing

Thread Next
Michael G Schwern
August 12, 2001 14:36
Expunge implicit @_ passing
Message ID:
Odd feature of perl5:

    sub bar { &foo }
    sub foo { print @_ }

    print bar("It's Mmmmmaaaaagic!");

When foo() is called as &foo with no parens and no arguments, it
inherits @_ from it's caller.

This might have been originally introduced as an efficient way to pass
huge sets of arguments without copying before references were
introduced, but that's not a problem anymore.  foo(@_) or goto &foo
works just fine.

I can't think of any reason why this feature is useful anymore, and it
can be a really confusing behavior, so what say we kill it in Perl 6?


Michael G. Schwern   <>
Perl6 Quality Assurance     <>	     Kwalitee Is Job One
You see, in this world there's two kinds of people.  Those with loaded
guns, and those who dig.  Dig.
		-- Blonde, "The Good, The Bad And The Ugly"

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About