> # I am thinking one should have to predeclare
> # in a sub's preamble that such a trick will
> # be going on.
> #
> # Thus something like:
> # 
> #     sub foo [&bar] { ... }
> # 
> # is (part of what is) required to be allowed
> # to create a bar sub in the context of the
> # caller of foo.
> 
> So how does Exporter declare its import() function?

Keeping things simple, something like:

    method import [*] { ... }

is required if one is to use $CALLERS::
in the body.

Skip the rest unless you enjoy flights
of pure fancy.

=========

Being really radical, perhaps [*] means
that all the lexicals in the caller are
mapped to an identical set of lexicals
in the called. Dangerous stuff, huh?

Entering the realms of the truly insane,
one could have something like:

    method import (@symbols)
                  [ { @symbols } ]
    { ... }

to indicate run time eval of the locals
list, but the above ignores all sorts
of practical problems and is plainly
huge overkill for the situation.

(All of this would of course still be
subject to the Yours property that by
default restricts localization to the
topic, and to non-existent lexicals,
ones the called sub intends to /add/
to the caller's lexical context.)

--
ralph

Reply via email to