Skip Menu |

This queue is for tickets about the version CPAN distribution.

Report information
The Basics
Id: 20218
Status: resolved
Priority: 0/
Queue: version

People
Owner: Nobody in particular
Requestors: STEFFENW [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.64
Fixed in: (no value)



Subject: there is no overload from + to numify()
# string context is working print ''.qv('1.2.3'); v1.2.3 # numeric context doesn't work print 0+qv('1.2.3'); Operation `+': no method found, left argument has no overloaded magic, right argument in overloaded package version at ... # looks good print qv('1.2.3') > qv('1.2.2'); 1 # looks good too print qv('1.2.3') > 1.002_002; 1
CC: undisclosed-recipients:;
Subject: Re: [rt.cpan.org #20218] there is no overload from + to numify()
Date: Sat, 01 Jul 2006 10:30:04 -0400
To: bug-version [...] rt.cpan.org
From: John Peacock <jpeacock [...] rowman.com>
Steffen Winkler via RT wrote: Show quoted text
> # numeric context doesn't work > print 0+qv('1.2.3'); > Operation `+': no method found, > left argument has no overloaded magic, > right argument in overloaded package version at ...
That's actually a deliberate design decision. Version objects (in their basic form) are intended to be immutable "set and forget" values. I have some ideas for a version::Math class which will allow specific mathematical operations to be performed (for example, automatically incrementing a module $VERSION before release to CPAN). What use case did you have for being able to use version objects in this way? John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Blvd Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747
From: STEFFENW [...] cpan.org
It was a test (what can I do) and not a problem for me, so I selected "Unimportant" and it's not realy a wish. I thourght the version module should be complete. You have implemented the string context, but why no the numeric context. I love this v-strings and v-strings are more than versions. It's nearly how we humas think hierarchical about versions or numbers in content lists too.
I'm going to close this as WONTFIX. Hopefully sometime soon I'll be able to release my version::Math module to CPAN, which will allow sensible math operations on version objects. Thanks John