ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl6-language
perl6-language
Re: AUTLOAD and $_
by Luke Palmer other posts by this author
Jun 21 2005 6:35AM messages near this date
Re: AUTLOAD and $_ | Re: AUTLOAD and $_
On 6/21/05, Adam Kennedy <cpan@[...].as>  wrote:
>  You are of course assuming that every use of AUTOLOAD, for all time,
>  will result in
>  
>  a) Calling another function
>  b) An error
>  
>  Wouldn't this lead to hacks where people do things like this just to
>  prevent perl thinking it's a failure?
>  
>  sub AUTOLOAD ($whatever) {  # but no *@_
>        my $s = get_subref_for $whatever;
>        our &::($whatever) := $s;
>        return sub () { 1 };
>  }
>  
>  The ability to get complete control over the params and context of the
>  function, and maybe run something else AFTER the function call is important.

I think people are being pretty closed-minded about closures.  If it
comes down to it, you can always get your good old Perl 5 AUTOLOAD
like this:

    sub AUTOLOAD ($whatever) { sub (*@_) {
        ...
    } }

Luke
Thread:
Sam Vilain
Juerd
Sam Vilain
Maxim Sloyko
Juerd
Adam Kennedy
Juerd
Luke Palmer
Chromatic
Juerd
Chromatic
Juerd
Luke Palmer
John Macdonald
Chromatic
Juerd
Rod Adams
Larry Wall
Rod Adams
Chromatic
Juerd
Sam Vilain
Sam Vilain
Juerd

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved