in reply to Detecting an imported function
For the heck of it, I'll suggest the low-tech approach of building a list of routines at BEGIN time and excluding these from the list of traits built at run time.
It isn't obvious from a quick glance when / how the post-compilation moving of all subroutines happens (I guess when the trait-implementing package gets imported), but that must already be happening. So all you need to add is code to cache the list of to-exclude subroutines when Class::Trait::import is called (and then exclude them, of course).
Of course, this means that the user needs to 'use' modules that import non-traits before 'use'ing Class::Trait. But it also means that the user can do creative things that 'import' subroutines that are meant to be traits... Which I find rather appealing.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Detecting an imported function (exclude time)
by diotalevi (Canon) on Nov 17, 2005 at 16:11 UTC | |
|
Re^2: Detecting an imported function (exclude time)
by Ovid (Cardinal) on Nov 17, 2005 at 16:31 UTC | |
by Roy Johnson (Monsignor) on Nov 17, 2005 at 16:44 UTC | |
by Ovid (Cardinal) on Nov 17, 2005 at 17:35 UTC | |
by tye (Sage) on Nov 17, 2005 at 16:46 UTC | |
by Ovid (Cardinal) on Nov 17, 2005 at 17:40 UTC | |
by tye (Sage) on Nov 17, 2005 at 18:06 UTC |