On Thu, Jul 10, 2003 at 05:15:17PM +0100 Nicholas Clark wrote:

> On Wed, Jul 09, 2003 at 03:23:18PM -0400, Marc Mettes wrote:

> > In my XS module, I need to make numerous enum's available to perl 
> > and I'm looking for recommendations on which option to chose to 
> > implement them.

[...]

> If you want an example of how this works, all of the core modules that were
> using "constant" code generated by the old h2xs have been re-implemented using
> the new strategy in 5.8.0, as does Time::HiRes on CPAN.
> (Actually Time::HiRes is not a good example as it does lots of other stuff
> in its Makefile.PL, and it generates the list of constants with non-standard
> defaults)
> 
> Admittedly, I'm biased, because I did the h2xs re-write and wrote the
> associated support module, ExtUtils::Constant (in 5.8.0, and on CPAN)

And I'd like to add that ever since I first heard about
ExtUtils::Constant (which is automatically invoked if you use the -b
switch on a recent h2xs) I never looked back. Nicholas did an ingenious
job there...it fixes all of the old problems that were: a) an
unmaintainable muddle of auto-generated C code and b) the fact that this
autogenerated code was even erroneous...some constants weren't properly
handled. Correcting that was almost impossible due to a).

Furthermore, it does not add a dependency in that you don't need
ExtUtils::Constant on machines installing your module.

BTW: When you have a lot of enums, you should consider using the freshly
released perl5.8.1-RC1 (or just the h2xs of that). Older h2xs' ignored
enums...after my patches (shamelessly plugged) they handle those, too.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval

Reply via email to