develooper Front page | perl.perl5.porters | Postings from May 2002

Re: [PATCH] Storable (Re: perl@16433)

From:
Nicholas Clark
Date:
May 7, 2002 15:26
Subject:
Re: [PATCH] Storable (Re: perl@16433)
Message ID:
20020507221628.GB306@Bagpuss.unfortu.net
On Tue, May 07, 2002 at 09:13:28PM +0100, Tim Bunce wrote:
> On Tue, May 07, 2002 at 05:08:08PM +0100, Nicholas Clark wrote:
> > The dog doesn't read p5p, so I think I can get away with it.

Well, he did get 1 walk this evening. (I left my FreeBSD box building 5.6.1
with threads)

> Ah, I missed that (too fast with the delete key when skimming my mailboxes).
> 
> +	} else if (type >= SX_ERROR && cxt->ver_minor > STORABLE_BIN_MINOR) {
> +            if (cxt->accept_future_minor < 0)
> +                cxt->accept_future_minor
> +                    = (SvTRUE(perl_get_sv("Storable::accept_future_minor",
> +                                          TRUE))
> +                       ? 1 : 0);
> +            if (cxt->accept_future_minor == 1) {
> +                CROAK(("Storable binary image v%d.%d contains data of type %d. "
> +                       "This Storable is v%d.%d and can only handle data types up to %d",
> +                       cxt->ver_major, cxt->ver_minor, type,
> +                       STORABLE_BIN_MAJOR, STORABLE_BIN_MINOR, SX_ERROR - 1));
> +            }
> +        }
> 
> I've not looked at the code in context, but if type >= SX_ERROR
> then don't you *have* to croak? I think the accept_future_minor
> test only applies at the point the cxt->ver_minor is set from the
> header.

Yes, you're right, you do *have* to croak. The conditional code is deciding
whether to croak with a the new message you see, or the traditional
"Corrupt Storable binary" message. I didn't think that the "corrupt"
message was correct (let alone helpful) if the problem was a new data type.

> > What version number should it be released as?
> 
> I'd vote for 2.00 since it's a significant improvement in many ways
> from the 1.01 that's 'out there'. It'll also align it with the
> value of STORABLE_BIN_MAJOR (which hopefully now won't change for
> a long time).

I'm feeling conservative - at the moment the .pm thinks it's 1.015

Nicholas Clark
-- 
Even better than the real thing:	http://nms-cgi.sourceforge.net/



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