develooper Front page | perl.perl5.porters | Postings from August 2001

Re: vstring guidance needed

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
August 17, 2001 14:18
Subject:
Re: vstring guidance needed
Message ID:
20010817232024.A7041@rafael
On 2001.08.17 19:18 John Peacock wrote:
> I discovered where PL_patchlevel is being set and I can deal with it
> by making it call new_vstring, but it sort of begs the question:
> 
> 	WHAT ARE VSTRINGS ANYWAY?

An idea: Have you checked back the p5p archives, when the vstrings were
introduced?

> Internally, do we want to store a PV only, and make all version code
> use cmp, lt, eq, etc., or do we want to continue to store both a 
> NV numeric representation and a SV (U8) representation?

I believe that the NV is only constructed for vstrings (or version strings,
the difference you make between the two is not clear to me) used in 'use'
and 'require' statements.

> Do we want this:
> 
> SV = PV(0xa011468) at 0xa01f7c8
>   REFCNT = 1
>   FLAGS = (POK,READONLY,pNOK,pPOK)

I don't understand why pNOK is set here. Did your implementation used
a numerical representation while constructing the SV? Looks like the
shadow of a bug to me.

>   PV = 0xa017b68 "\0\35\0\1"\0
>   CUR = 4
>   LEN = 5
> 
> or this
> 
> SV = PV(0xa011468) at 0xa01f7c8
>   REFCNT = 1
>   NV = 0.029000001
>   FLAGS = (NOK,POK,READONLY,pNOK,pPOK)
>   PV = 0xa017b68 "\0\35\0\1"\0
>   CUR = 4
>   LEN = 5
> 
> be the representation of
> 
> Dump(v0.29.0.1);
> 
> I am willing to go either way.  It would be nice for both
> 
> 	$vstring < v1.2.3     and      $vstring lt v1.2.3
> 
> to yield the same answer.  What do people think, given that vstrings
> are also intended to be used to code UNICODE strings?

Well, PV can be of an arbitrary length, while NV can't. That would speak
against the NV. On the other hand, I don't see how "$scalar < v1.2.3"
would work without an NV (or IV) equivalent of the vstring PV.

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