D, Parasail, Pascal, and Rust vs The Steelman

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Mar 21 16:19:35 UTC 2018


On Wed, Mar 21, 2018 at 04:08:07PM +0000, Martin Tschierschke via Digitalmars-d wrote:
> On Wednesday, 21 March 2018 at 12:52:19 UTC, Paulo Pinto wrote:
[...]
> > [0] - https://en.wikipedia.org/wiki/Steelman_language_requirements
> 
> Interesting!
> 
> Do you understand this:
> 
> > 7H. Formal Array Parameters. The number of dimensions for formal
> > array parameters must be specified in programs and shall be
> > determinable during translation. Determination of the  subscript
> > range for formal array parameters may be delayed until invocation
> > and may vary from  call to call. Subscript ranges shall be
> > accessible within function and procedure bodies without being passed
> > as explicit parameters.
> 
> > Subscript ranges are not accessible in D or Rust.
> 
> I do not understand the meaning of "subscript ranges"? Isn't this
> slicing?

AFAICT, "subscript" in the spec just means the range of valid array
indices (it's old terminology from the 70's / 80's).

In which case, it is not true that subscript ranges are not accessible
in D (I don't know about Rust); all D arrays have indices from 0 to
.length-1, so the callee can always access the range of allowed indices,
and the caller never has to pass .length explicitly.


T

-- 
It only takes one twig to burn down a forest.


More information about the Digitalmars-d mailing list