Re: RE: [PEAR] [ANNOUNCEMENT] Numbers_Words-0.7.1 (beta) Released.

From: Date: Tue, 25 May 2004 14:27:19 +0000
Subject: Re: RE: [PEAR] [ANNOUNCEMENT] Numbers_Words-0.7.1 (beta) Released.
References: 1 2 3 4 5 6 7 8 9  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-29636@lists.php.net to get a copy of this message
David, David Costa wrote:
On May 25, 2004, at 3:48 PM, Antonio Carlos Venancio Junior wrote:
On May 25, 2004, at 3:20 PM, Antonio Carlos Venancio Junior wrote: snip
    So, we are missing a link to that path here:
---------- http://pear.php.net/package/Numbers_Roman
I don't control that, it's part of pearweb
----------
    I'll ask your permition to change some lines in your code to make it faster and "validate" the roman numbers to avoid things like "Numbers_Roman::toNumber('VX')" or "Numbers_Roman::toNumber('VIIII')" and so on.
????? Sorry but the package is very simple and I don't think that is slowed down by anything. To Number works fine for me so I don't understand what we are trying to avoid.
    That are only two examples of _wrong_ roman numbers, because 'VX' doesn't exists and its computed as a 5 (five). And the correct form of a nine (9) is 'IX' and not 'VIIII'.
This is not a problem, if you convert VX that is not a valid numeral so it's your fault I assume. Same for VIIII. It will return you a rough guess, which cannot be accurate if you pass an invalid numeral. toNumber expects a valid Numeral as input.
Yeah, i think it _is_ a problem. You have to parse the number and raise an error when the conversion could not be made, i.e. because the user passed a "bad" roman number. Try to remember when you have learned semanthics (and roman numbers too). You need to understand that 'VIIII' _is not_ the representation of the number nine (9). The correct representation is 'IX'. You will never find a book with page 'VIIII', gotcha?!
Of course if this is bad for your personal use, feel free to fork your own version and do it your way, by all means this is something you can do.
That's why we need a QA team. This package certainly whould not be aproved that way. I just made an "expect to fail" test to the class that not failed. That's the basics. -- Ate' Antonio "Can't buy what I want because its FREE!" - Pearl Jam

« previous php.pear.dev (#29636) next »