From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,eda0a7cd6069ee4 X-Google-Attributes: gid103376,public From: wf@dcs.gla.ac.uk (Bill Findlay) Subject: Re: Type mess in Ada standard library Date: 1999/07/22 Message-ID: #1/1 X-Deja-AN: 504090237 References: <7n1uu4$so8$1@pegasus.csx.cam.ac.uk> <7n32tt$cio$1@nnrp1.deja.com> <7n41v3$j6$1@pegasus.csx.cam.ac.uk> Organization: The University of Glasgow Newsgroups: comp.lang.ada Date: 1999-07-22T00:00:00+00:00 List-Id: In article <7n41v3$j6$1@pegasus.csx.cam.ac.uk>, mgk25@cl.cam.ac.uk (Markus Kuhn) wrote: > > Would it at the same time also be possible to add anonymous arrays? > > typ'Array(0..255,0..255) -- anonymous 64k 2D array of typ > typ'Array(<>,<>,<>) -- any 3D array of typ > > or something like that, which wherever they are used lead to identical > types iff the parameters are identical. This is beginning to look somewhat like (BS/ISO) Standard Pascal conformant array parameters! When I posted on Pascal's type relations I restrained myself from a presentation of the relationship of "conformability" between an array type and a conformant array schema. Essentially, conformant array parameters provide anonymous array parameter types, with syntax that smuggles the array 'first and 'last attributes into Pascal. They were motivated by the problem of binding to libraries of array-intensive routines (especially, NAG) in the context of Pascal's lack of unconstrained array types; but they also greatly alleviated the difficulty of writing reusable string handling subprograms in Standard Pascal. (I.e. they made it possible to write reusable string handling!) Example: procedure sayHello (name : packed array [low..high : Integer] of Char); var i : Integer; begin write('Hello: '); for i := low to high do write(name[i]); end; ... sayHello('Bill'); sayHello('sailor'); Excuse any Ada-isms in the syntax - it's a long time since I last wrote Pascal code. 8-) The introduction of conformant array parameters was the only bit of new language design that the authors of BS Standard Pascal indulged in; but we did so at the specific request of Niklaus Wirth and Tony Hoare, so we felt ourselves righteously justified! -- Bill Findlay Department of Computing Science The University of Glasgow