From: Helmut Brandl <helmut.brandl@gm...> - 2009-09-10 17:15:54
Emmanuel Stapf [ES] wrote:
>>> As there is no imlpicit conversion from INTEGER to NATURAL,
>> Why not? INTEGERs and NATURALs of the same bit size can be converted
>> without loss of information.
> Not true. You cannot convert -1 which is a valid INTEGER, but meaningless for
>> >From the beginning of Eiffel the most basic type has been INTEGER. Array
>> indices are INTEGER and not NATURAL. If you want to change CHARACTER or
>> STRING I would recommend to change the code in STRING to INTEGER to be
> Actually there is a push for using NATURAL, but it has been held back due to the
> breaking changes impact. And this is exactly what Alexander is pointing out.
Do you mean that NATURAL will be used as an index in ARRAYs as well? Or
just for character codes?
The latter one seems ok. But the former one will cause a lot of
confusion unless there is a conversion from INTEGER to NATURAL. In
addition that would prohibit negative indices in ARRAYs. Therefore I
assume you just meant NATURALs for character codes. Right?