develooper Front page | perl.perl5.porters | Postings from March 2000

Re: AUTOLOADREF

Thread Previous
From:
Ilya Zakharevich
Date:
March 15, 2000 10:55
Subject:
Re: AUTOLOADREF
Message ID:
200003151855.NAA17865@monk.mps.ohio-state.edu
M.J.T. Guy writes:
> All these problems have the same root cause  -  the fact that you can't
> load a subroutine without also calling it.

Nope, they have two roots: this one, and that you cannot run some
action when an undefined subroutine is seen at *compile* time.

See my proposal on 'use autoload'.

> So I propose a new reserved subroutine AUTOLOADREF.   (The name is
> deliberately ugly to encourage people to make better suggestions.
> Also see below for an alternative to a new reserved word.)

No new magic names, please!  In my proposal what you want would be
installed by

  use autoload body => \&AUTOLOADREF;

But there is an additional (and separate!) callback to be called at
compile time:

  use autoload proto => whatever;

which should return the prototype (but may have an arbitrary side
effect like defining the subroutine).

Ilya

Thread Previous


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