Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!VTVM1.BITNET!GRANGERG From: GRANGERG@VTVM1.BITNET (Greg Granger) Newsgroups: comp.lang.modula2 Subject: Re: Modula2 front end for gcc? Message-ID: Date: 17 Jul 89 18:03:28 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Modula2 List Organization: The Internet Lines: 25 IMHO the implementation of a variable number of parameters should be as follows: -Introduce a new data type that is compatible will all other data types and can only be used in a formal parameter list (similar to ARRAY OF WORD). Call this new type DESCRIPTOR. -Variables of type DESCRIPTOR will be records containing the variable's type, location and size. Variables of type RECORD and ARRAY will require additional type information. Fields for element width and type can be added for ARRAYs. RECORD types can be implemented as a linked list of DESCRIPTOR. In this way the parameter ARRAY OF DESCRIPTOR would allow you to pass a variable number of paramenters, and still retain limited (user enforced) type checking. Possible problems: References could be determined at compile time, except of course for location values. Parameters of type DESCRIPTOR could not be passed to other procedures, because it would be difficult (impossible?) to determine references at compile time. Still it seems that this approach would allow greater flexiblity and consistency with M2. Greg