Pascal user manual and report; 3rd ed.
Pascal user manual and report; 3rd ed.
ACM SIGPLAN Notices
Reply to a paper by A. N. Habermann on the programming language Pascal
ACM SIGPLAN Notices
Some improvements of ISO-Pascal
ACM SIGPLAN Notices
Some improvements of ISO-Pascal
ACM SIGPLAN Notices
Hi-index | 0.00 |
Many persons have criticized—or defended— Pascal [1] for its lack of conformant arrays [2,3]. A conformant array is a formal parameter array whose bounds will conform to those of an actual parameter array. (The element types of both must be the same.) The lack of this feature is due to a desire for efficient compilation and execution. It is enforced by Pascal's convention that the index or bounds specification of an array is an integral part of the type of the array. For example, in: TYPE LIST&equil;ARRAY[1..10] OF REAL; LOST&equil;ARRAY[1..5] OF REAL; VAR LI: LIST; LO: LOST; LA: ARRAY[1. 10 ] OF REAL; FUNCTION SUM(A: LIST): REAL; it can be seen that the array bounds are nowhere specified in the parameter declaration; they are buried within the type definition. Thus, the call SUM(LI) is syntactically correct, but SUM(LO) is not, because the type of LO does not match the formal parameter. The call SUM(LA) is not correct, because LA has an anonymous (unnamed) type that matches (by convention) no other types. There is no way to generalize the SUM procedure to accept various arrays of reals.