Wed Jun 23 16:26:23 2010: Request 58579 was acted upon.
Transaction: Correspondence added by MBARBON
Queue: Wx
Subject: Compile Wx constants without exporting Wx constants
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: [email protected]
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=58579 >
Il Mar 22 Giu 2010 07:27:02, ADAMK ha scritto:
> I would love to see some kind of similar effect implemented in Wx core
> itself, perhaps via a ':compile' type option.
>
> This would save Padre from importing all those symbols into Padre::Wx,
> and would greatly simplify code generators producing Wx code, because
> they don't have to track and import each constant used.
>
> Perhaps it would just be better to declare all the constants full all
> the time, or to declare all the constants consumed by a class (say,
> Wx::Dialog) by default whenever each class that can use them are loaded.
Sadly, there isn't any delayed loading implemented yet.
> It feels like there should be some way of doing this better than what is
> done now...
I suppose all you need is:
m/^:some_meaningful_name$/ and do {
require subs;
subs->import( @EXPORT_OK );
};
in Wx::import? I tried it in an one-liner and it seems to do what you need.
Regards,
Mattia