🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #207

Open arrays

#207
From: Pat Terry
Date: Sat, 05 Aug 1989 15:47
94 lines
3373 bytes
(* PARAMETER COMPATIBILITY OF OPEN ARRAY PARAMETERS

At the Linz meeting of WG13 it was asserted that open array parameters
had always been intended (by Wirth) to be parameter compatible with
values or variables of the component type. For example, a CHAR would
be parameter compatible with ARRAY OF CHAR. It was also asserted that
most implementations already provided such functionality. It was
proposed that the formal definition be changed to reflect these
assertions -- thereby standardizing existing practice. The meeting
decided to canvas Prof. Wirth's opinion and Mark Woodman suggested
testing compilers.

************************************************************************
*  A list of compilers follows the program, together with names of those
*  already tested.
*  If you have access to a to compilers which have not been tested,
*  I would appreciate results from them.
***********************************************************************


Thanks,

Posted by Pat on behalf of Mark Woodman, Open University
-----------------------------------------------------
*)


MODULE TestComps;
TYPE ArrayType = ARRAY [0..1] OF INTEGER;
VAR
  Simple: INTEGER;
  Array: ArrayType;
  (* Global variable of type INTEGER or CARDINAL, depending on result type
     of HIGH. Variable used to check correct handling of value as array. *)
  high: CARDINAL;
PROCEDURE TestSimple(ex: ARRAY OF INTEGER);
  BEGIN
    high := HIGH(ex);
  END TestSimple;
PROCEDURE TestSimpleVar(VAR vr: ARRAY OF INTEGER);
  BEGIN
    high := HIGH(vr);
  END TestSimpleVar;
PROCEDURE TestArray(exa: ARRAY OF ArrayType);
  BEGIN
    high := HIGH(exa);
  END TestArray;
PROCEDURE TestArrayVar(VAR vra: ARRAY OF ArrayType);
  BEGIN
    high := HIGH(vra);
  END TestArrayVar;
BEGIN
  (* initialize variables *)
  Simple := 0;
  Array[0] := 2;
  Array[1] := 3;
  TestSimple(Simple);
  TestSimpleVar(Simple);
  TestArray(Array);
  TestArrayVar(Array);
END TestComps.


(*
Compiler
------------------------------------
Ana 68 (Sun)             |
Collier V2               |  Tested
FST                      |  Tested
FTL                      |  Tested
Hamburg VAX              |  Tested
HP9000/800               |  Tested
Logitech (MS-DOS 3.03)   |  Tested
Logitech (VAX)           |
MacMeth                  |  Tested
MacModula-2              |  Tested
Modula/370               |
Oregon (80386/Xenix)     |  Tested
Oregon (Sun)             |
Pecan Modula-2           |
Rowley                   |
Stonybrook               |
Stonybrook  (Quickmod)   |  Tested
Taylor                   |
TDI (Atari ST)           |
TopSpeed                 |  Tested
Volition Sage/Stride     |  Tested

*)


--  
uucp: {mcvax!uunet,tektronix,sun!nosun}!oresoft!dawggon!2!490!19.101!Pat.Terry
Internet: Pat.Terry@p101.f19.n490.z2.fidonet.org
Technical Details
Message-ID: <2906.24DBFDFE@dawggon.fidonet.org>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!pacbell!ames!ncar!unmvax!indri!caesar!blake!ogccse!cvedc!nosun!qiclab!m2xenix!dawggon!p101.f19.n490.z2.fidonet.org!Pat.Terry

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!pacbell!ames!ncar!unmvax!indri!caesar!blake!ogccse!cvedc!nosun!qiclab!m2xenix!dawggon!p101.f19.n490.z2.fidonet.org!Pat.Terry
From: Pat.Terry@p101.f19.n490.z2.fidonet.org (Pat Terry)
Newsgroups: comp.lang.modula2
Subject: Open arrays
Message-ID: <2906.24DBFDFE@dawggon.fidonet.org>
Date: 5 Aug 89 15:47:32 GMT
Sender: ufgate@dawggon.fidonet.org (newsout1.26)
Organization: FidoNet node 2:490/19.101 - Settler City Fido, Grahamstown RSA
Lines: 94