What is Expressiveness in a Computer Language
Dimitri Maziuk
dima at 127.0.0.1
Wed Jun 21 12:12:48 EDT 2006
George Neuner sez:
> On Mon, 19 Jun 2006 22:02:55 +0000 (UTC), Dimitri Maziuk
><dima at 127.0.0.1> wrote:
>
>>Yet Another Dan sez:
>>
>>... Requiring an array index to be an integer is considered a typing
>>> problem because it can be checked based on only the variable itself,
>>> whereas checking whether it's in bounds requires knowledge about the array.
>>
>>You mean like
>> subtype MyArrayIndexType is INTEGER 7 .. 11
>> type MyArrayType is array (MyArrayIndexType) of MyElementType
>>
>
> If the index computation involves wider types it can still produce
> illegal index values. The runtime computation of an illegal index
> value is not prevented by narrowing subtypes and cannot be statically
> checked.
My vague recollection is that no, it won't unless _you_ explicitly code an
unchecked type conversion. But it's been a while.
HTH
Dima
--
I have not been able to think of any way of describing Perl to [person]
"Hello, blind man? This is color." -- DPM
More information about the Python-list
mailing list