in reply to Re^5: Pure perl lexical sub import (POC)
in thread Pure perl lexical sub import
The longer story for the situation that triggered the question is that I was working on changes to CodeGen::Cpppp, and one of my goals for that module is to make it fat-packable, or even just drop it's source code in a scripts/ directory alongside the source code of a project written in C. The idea would be to generate the C files if possible, and then write Makefile rules that let people regenerate the files as long as they have perl-5.20 or newer. (without them knowing anything about perl or how to install perl modules). Cpppp currently needs 5.20 and so now I'm debating whether to up that to 5.22.
Meanwhile, the other reason I wanted to know if there was a way is because I have my own Exporter::Extensible which is currently pure-perl, and can't do lexical exports. Now that I know it's possible without XS, I'd like to add a feature to that so you can say use SomeModuleUsingEE -lexical => 'foo';. This is on my back-burner, but something I'd like to have eventually.
In the grand scheme of things, I think it's probably better to go with an 'Importer' design than an 'Exporter' design, and if I'd found Importer before I wrote Exporter::Extensible I probably would have gone a different direction, focused on making it easy to AUTOLOAD the generated functions so that Importer can find them.
In light of all that, I'll let you decide how best to spend your time :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Pure perl lexical sub import (POC)
by LanX (Saint) on Dec 23, 2024 at 17:36 UTC |