It looks like my reply went only to Helmut. It is repeated below:
Helmut Brandl 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.
It's not that easy to convert {INTEGER_32} -1 to NATURAL_32, as well as it's
not that easy to convert {NATURAL} 0xFFFFFFFF to INTEGER_32.
> 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
> consistent.
To the best of my knowledge Unicode code points are unsigned, so it's much
more convenient to have them unsigned in Eiffel. I think character code is more
often used as a unicode code point rather than as an index to an array.
Regards,
Alexander Kogtenkov
----- Original Message -----
From: "Helmut Brandl" <
[hidden email]>
To: <
[hidden email]>
Sent: Thursday, September 10, 2009 7:13 PM
Subject: Re: [freeelks-devel] CHARACTER.code and STRING_GENERAL.code
> Alexander Kogtenkov wrote:
>> It looks like there is a type mismatch between
>> CHARACTER.code and STRING_GENERAL.code.
>> The latter is used to define other operations on strings:
>> in append, put_code, etc.
>>
>> The types are
>> - in CHARACTER_XX - INTEGER_32
>> - in STRING_GENERAL - NATURAL_32
>>
>> 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.
>
>> one should write the code like
>>
>> c: CHARACTER_8
>> s: STRING_GENERAL
>> ...
>> s.append_code (c.to_character_32.natural_32_code)
>>
>> that does not look straitforward compared to the expected
>>
>> s.append_code (c.code)
>>
>> Would it make sense to change the declaration of CHARACTER_XX.code
>> be of type NATURAL_32?
>
>>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
> consistent.
>
> Regards
> Helmut
>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.
http://p.sf.net/sfu/bobj-july> _______________________________________________
> freeelks-devel mailing list
>
[hidden email]
>
https://lists.sourceforge.net/lists/listinfo/freeelks-devel>
>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.
http://p.sf.net/sfu/bobj-july_______________________________________________
freeelks-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freeelks-devel