[fpc-pascal] Re: StrUtils.RomanToInt oddities

Martin lazarus at mfriebe.de
Mon Sep 23 23:26:21 CEST 2013


On 23/09/2013 22:30, Alberto Narduzzi wrote:
>> What about making an option of it?
>>
>> Anyhow, if the function accepts invalid combinations, what should it
>> return? For some, the answer would be obvious (IIII), but some
>> combinations are indeed ambiguous (IIIIM) So that we maybe could accept
>> unambiguous invalid combinations, but I don't see how to accept
>> ambiguous ones.
>
> they are not ambiguous, they are simply INVALID.

So the question is, what does or should do RomanToInt for invalid input?

It is NOT called "CheckValidRoman", so it could be that the result for 
invalid input is simply undefined. If it is, then all is ok.



More information about the fpc-pascal mailing list