[fpc-pascal] Re: StrUtils.RomanToInt oddities
Alberto Narduzzi
albertonarduzzi at yahoo.com
Thu Sep 26 20:14:18 CEST 2013
> My 2 cents on the "strictness" of the parsing.
>
> Since there are various, more or less accepted, "rules", a
> "strictness" parameter could be added as an optional parameter to the
> function.
> It does not break consistency with other conversion functions, since
> they are hardly open for interpretation, and so they don't need such a
> thing.
>
> Strictness modes could be:
> - Strict: most strict set of rules (it does not accept numbers> 3999,
> nor more than 3 repeats of the same numeral)
> - Relaxed: allows unlimited number of starting "M", and allows up to 4
> repeats of C, X and I.
> - DontCare: like current behaviour.
Now, this is a very nice and clean approach to the problem, together
with an equally nice and clean solution.
Cheers, A.
More information about the fpc-pascal
mailing list