Article View: net.lang.mod2
Article #544Re: THe type of Indexes in Open Array Parameters
From: Charles D. Farnum
Date: Fri, 03 Oct 1986 18:13
Date: Fri, 03 Oct 1986 18:13
17 lines
1482 bytes
1482 bytes
In article <12243873849.8.PATTIS@WARD.CS.WASHINGTON.EDU> PATTIS@WARD.CS.WASHINGTON.EDU (Richard Pattis) writes:
>What is the type of the index in open array parameters? How can you justify
>your answer (quotes from Wirth)? ...
According to the third edition of ``Programming in Modula-2'', p. 152,
section 8.1 of the Report:
...the designator A[E] denotes that component of A whose index is the
current value of the expression E. The index type of A must be
_assignment_compatible_ [emphasis Wirth's] with the type of E...
The index type of an open array thus becomes academic; if we assume that
it is some subrange of CARDINAL or INTEGER, then it doesn't matter which
choice we make since subranges of CARDINAL and INTEGER are assignment
compatible (section 9.1).
/charlie
Technical Details
Message-ID:
<15903@ucbvax.BERKELEY.EDU>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbatt!cbosgd!ucbvax!renoir.Berkeley.EDU!farnumReferences:
<12243873849.8.PATTIS@WARD.CS.WASHINGTON.EDU>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!cbatt!cbosgd!ucbvax!renoir.Berkeley.EDU!farnum From: farnum@renoir.Berkeley.EDU (Charles D. Farnum) Newsgroups: net.lang.mod2 Subject: Re: THe type of Indexes in Open Array Parameters Message-ID: <15903@ucbvax.BERKELEY.EDU> Date: Fri, 3-Oct-86 14:13:07 EDT Article-I.D.: ucbvax.15903 Posted: Fri Oct 3 14:13:07 1986 Date-Received: Sat, 4-Oct-86 12:28:57 EDT References: <12243873849.8.PATTIS@WARD.CS.WASHINGTON.EDU> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: farnum@renoir.Berkeley.EDU.UUCP (Charles D. Farnum) Organization: University of California, Berkeley Lines: 17