Re:Ada is not just another programming language (1986)
by Cloudef on Saturday October 30, 2021 @12:59AM
(#29046103)
Yes, it's enforced by any _runtime_ operation.
See: https://www.adaic.org/resources/add_content/standards/05rm/h...
Re:Ada is not just another programming language (1986)
by Jtsummers on Saturday October 30, 2021 @01:01AM
(#29046114)
The range wouldn’t change in Ada. The type for a variable is fixed at compile time. It will ensure (at runtime and partially at compile time) that the value doesn’t go outside the range, though.
Re:Ada is not just another programming language (1986)
by throwaway81523 on Saturday October 30, 2021 @01:14AM
(#29046165)
Usually with runtime checks, but it can also in some situations be done statically, such as with SPARK.
Like, if I have a variable `i` in range 0...10 and write the Ada equivalent of `i++`, does Ada know that from there on out `i` is in range 1...11? Something like TypeScript's type narrowing?