Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: 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 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