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

Re: Expunge implicit @_ passing

Thread Previous | Thread Next
From:
Ken Fox
Date:
August 27, 2001 07:40
Subject:
Re: Expunge implicit @_ passing
Message ID:
3B8A5DD7.872E20D6@vulpes.com
Michael G Schwern wrote:
> 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?

I've always thought is was pretty useful for implementing generic
redirectors. I wrote a frame system that allows instances to over-ride
class methods. The basic idea is

  sub foo {
    my $method = $_[0]{"_foo"} || $_[0]->can("_foo");
    &{$method};
  }

The only thing I'd like to change is to make &foo a tail call instead
of a normal function call. But I guess that would *really* confuse
people.

- Ken

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About