[fpc-pascal] Re: StrUtils.RomanToInt oddities

Reinier Olislagers reinierolislagers at gmail.com
Tue Sep 24 10:18:44 CEST 2013


On 24/09/2013 09:09, Marco van de Voort wrote:
> In our previous episode, Bart said:
>>> Raise an exception
>>
>> This will break existing implementations that either expect IM to be
>> 999, or ABC to be 0 (indicating failure), and that certainly do not
>> expect that this function throws an exception at them.
> 
> Yes, but since the routine probably has low utilisation I choose for
> structuring all conversion routines all the same.
I would rather choose for maintaining backward compatiblity, the *de
facto behaviour* (return 0 on invalid values) as it is quite sensible
for this kind of numbers.

> Moreover I don't think that first attempts should fixate interfaces
> and behaviour forever.
It's quite strange though that Delphi compatibility is quite insistently
adhered to (BTW a good decision IMO).
The function has been in FPC stable (for presumably a while?) so I would
really think hard before changing it.

> And let's not beat about the bush: the main reason for the routine is to
> show beginning programmers that their homework can be done using a fixed
> function :-)
Nice going to show beginning programmers how to break backward
compatibility then ;)

However, this is all just me 2c so it's up to the FPC devs to decide....

Regards,
Reinier



More information about the fpc-pascal mailing list