[comp.lang.modula2] Open arrays

Pat.Terry@p101.f19.n490.z2.fidonet.org (Pat Terry) (08/05/89)

(* 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