Sujet : Re: Simple Pascal question
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vmsDate : 05. Aug 2024, 02:23:09
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v8p9ht$9ptm$4@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
On 8/4/2024 8:09 PM, Dan Cross wrote:
In article <v8o4h8$2ut3$1@dont-email.me>,
Arne Vajhøj <arne@vajhoej.dk> wrote:
On 8/4/2024 8:22 AM, Dan Cross wrote:
In article <v8lpj0$ems$1@panix2.panix.com>,
Scott Dorsey <kludge@panix.com> wrote:
In article <v8hn3m$3aviu$1@gwaiyur.mb-net.net>,
Uli Bellgardt <UliBellgardtsSpamSink@online.de> wrote:
The value 1.5 should be an f_float value as well:
>
$ type zzz.pas
program z(input,output);
>
var
x : f_float;
>
This seems very strange to me... Pascal isn't supposed to have such
strong typing, is it? I don't remember ever having to manually coerce
anything. Or is f_float sufficiently different from a normal float?
>
Just to touch on the Pascal point itself, one of that language's
hallmarks is almost excessive rigidity in how it treats types.
>
Ada is even more strict.
Rust even more so.
There may be different definitions of strict.
But my take (apropos arrays) is:
level 0 - languages that use types of wider range than
array size as array index and do not check
whether an index is in range at runtime so
that programming errors with bad array indexes
result in unpredictable behavior at runtime
level 1 - languages that use types of wider range than
array size as array index and do check
whether an index is in range at runtime so
that programming errors with bad array indexes
result in an immediate exception
level 1.1 - languages that allow use of types of exact range of
array size as array index, but do not restrict
array index to that type and do check whether an
index is in range at runtime so that programming
errors with bad array indexes result in an immediate
exception
level 2.0 - languages that allow use of types of exact range of
array size as array index, and do restrict
array index to that type so that programming
errors with bad array indexes result in a compile error
Ada is level 2.0 (if using type and not subtype for array index).
Arne