Re: About putting the blame on other shoulders

[prev] [thread] [next] [Date index for 2004/12/30]

From: David Nicol
Subject: Re: About putting the blame on other shoulders
Date: 07:01 on 30 Dec 2004
On Tue, 28 Dec 2004 19:30:28 +0200, Issac Goldstand
<margol@xxxxxxxxx.xxx> wrote:
> the "use module  version" pragma only goes one way: up.
> 
>   Issac 

it's possible to trap the requested version number in your module and provide
the interface given by earlier versions when that is requested, but
it's a PITA and
an even bigger PITA if you want to support different versions getting
asked for in
different modules used within the same running system.

Here's how to do it:  within the import() function, store some behavior hints
to dynamic scalars with huge and unlikely names beneath the caller's name
space and refer to them whenver making version-specific choices.
Your module then gets bogged down with run-time polymorphism like so:

      no strict;
      return (
         # before version 7 this function returned a four-long arrayref
        ${caller().'::MyModule::VersioningSwitches::hashresults'} ?
         \%result : [@result{qw/foo bar baz blarfl/}]
       )

A better, more robust solution, which few do, and which would have avoided
the current debate, is to move version numbers implying incompatibility into the
name of the module rather than the version number.  If GD 2 had been
released as GD2,
if mod_perl 2 goes onto CPAN as modperl2, if all interface-changing new releases
append numbers to the module name rather than pretending to be new releases
of old interfaces, since the updating automatons don't grok the
distinction,  instead
of trying to get them to, and if this proposed standard nomenclature convention
can be somehow backdated several years, the world would be a better place would
it not?


        -- 
        David L Nicol
You're striving for harmony, and, if you try to take
 too much, you'll come to grief.  -- Michael Redmond

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

(message missing)

Re: Slashdot | Help Test mod_perl 2 Release Candidates
merlyn (Randal L. Schwartz) 20:34 on 26 Dec 2004

Re: Slashdot | Help Test mod_perl 2 Release Candidates
merlyn (Randal L. Schwartz) 15:09 on 27 Dec 2004

About putting the blame on other shoulders
Andreas J Koenig 14:28 on 28 Dec 2004

Re: About putting the blame on other shoulders
Stas Bekman 15:01 on 28 Dec 2004

Re: About putting the blame on other shoulders
Stas Bekman 15:54 on 28 Dec 2004

Re: About putting the blame on other shoulders
Andreas J Koenig 16:11 on 28 Dec 2004

Re: About putting the blame on other shoulders
Issac Goldstand 16:11 on 28 Dec 2004

Re: About putting the blame on other shoulders
Stas Bekman 16:27 on 28 Dec 2004

Re: About putting the blame on other shoulders
merlyn (Randal L. Schwartz) 16:43 on 28 Dec 2004

Re: About putting the blame on other shoulders
Issac Goldstand 16:58 on 28 Dec 2004

Re: About putting the blame on other shoulders
merlyn (Randal L. Schwartz) 17:09 on 28 Dec 2004

Re: About putting the blame on other shoulders
Issac Goldstand 17:30 on 28 Dec 2004

Re: About putting the blame on other shoulders
David Nicol 07:01 on 30 Dec 2004

Generated at 12:15 on 16 Jan 2005 by mariachi v0.52