develooper Front page | perl.perl5.porters | Postings from January 2004

Re: [perl #25268] h2xs does not create VERSION stubs

Thread Previous | Thread Next
From:
John Peacock
Date:
January 29, 2004 02:05
Subject:
Re: [perl #25268] h2xs does not create VERSION stubs
Message ID:
40165974.3090408@rowman.com
davidnico@cpan.org (via RT) wrote:
> nobody knows about the VERSION method except people who
> have thoroughly read perldoc -f use.  I believe that it
> would be a good thing if h2xs added a default VERSION
> method to the code it creates, and commented it out.  This
> commented-out code would have an obvious way to edit it in
> order to create a VERSION method that knows what lower version
> numbers the current version is incompatbile with.  

As the "official" VERSION maven, I'd appreciate it if this was _not_ the case. 
I don't have any problem with any developer desiring a finer control overriding 
the UNIVERSAL::VERSION with their own, but the thought of leading developers to 
believe that they could safely do it on their own would be just dangerous.

> 
> Let's say the current version is 2.3.4 and the current version
> supports the same interface as everything from 1.0.0 to 2.2.3
> but then an incompatibility was introduced in 2.2.4 which was
> taken out in 2.3.1.  We would want to describe this situation
> by uncommenting the VERSION code and editing a configuration
> structure something like this:
> 
>     {
> 	my %VERSION_INCOMPATIBILITY;
> 
> 	$VERSION_INCOMPATIBILITY{'[0.0.0,1.0.0)'} = 
> 		"constructor syntax has changed";
> 	$VERSION_INCOMPATIBILITY{'[2.2.4,2.3.1)'} = 
> 		"frobniz method croaks without second argument";
> 
> 	sub VERSION{
> 		... not sure exactly what goes here,
> 		but it parses (keys %VERSION_INCOMPATIBILITY)
> 		comparing each to the provided parameter; 
> 		`perldoc -f use` is not clear on whether the
> 		desired version arrives in $_[0] or $_[1] ...
> 
> 	}
>     }
> 

I think this is eminently doable with a version::Incompatible module (obviously 
based on my version module ;).  This would have the additional benefit that it 
would act a compatibility module between multiple versions of Perl.  I'm not 
done with the base "version.pm" module yet (some nagging leaks), but I have a 
working plan for the future.

Contact me offline...

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About