🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.mod2
Article #543

THe type of Indexes in Open Array Parameters

#543
From: Richard Pattis
Date: Fri, 03 Oct 1986 16:07
14 lines
1376 bytes
What is the type of the index in open array parameters?  How can you justify
your answer (quotes from Wirth)? This problem came up in the following context:
I have been using integer variables to index open array parameters; but the
PCollier compiler requires that open array parameters be accessed by using
the cardinal type.  I tried to convince myself that this was an error, but I
couldn't see anything in Wirth's book that directly supported my position.

To access declared types using integer indexes, I can write (according to the
new Modula-2 syntax) TYPE A = ARRAY INTEGER[1..10] OF T. The question could
be resolved if Wirth says that indexes must be assignment compatible (but not
compatible) with their declared (or implied) index types.

Rich
-------
Technical Details
Message-ID: <12243873849.8.PATTIS@WARD.CS.WASHINGTON.EDU>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!bellcore!ulysses!allegra!mit-eddie!genrad!decvax!ucbvax!WARD.CS.WASHINGTON.EDU!PATTIS

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!bellcore!ulysses!allegra!mit-eddie!genrad!decvax!ucbvax!WARD.CS.WASHINGTON.EDU!PATTIS
From: PATTIS@WARD.CS.WASHINGTON.EDU (Richard Pattis)
Newsgroups: net.lang.mod2
Subject: THe type of Indexes in Open Array Parameters
Message-ID: <12243873849.8.PATTIS@WARD.CS.WASHINGTON.EDU>
Date: Fri, 3-Oct-86 12:07:49 EDT
Article-I.D.: WARD.12243873849.8.PATTIS
Posted: Fri Oct  3 12:07:49 1986
Date-Received: Sat, 4-Oct-86 12:21:50 EDT
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The ARPA Internet
Lines: 14