Xref: utzoo comp.lang.modula2:775 comp.lang.misc:1436 Path: utzoo!mnetor!uunet!mcvax!diku!dkuug!daimi!erja From: erja@daimi.UUCP (Erik Jacobsen) Newsgroups: comp.lang.modula2,comp.lang.misc Subject: Re: Modula2's godawful IO. Message-ID: <1418@daimi.UUCP> Date: 13 Apr 88 11:21:26 GMT References: <764@ndsuvax.UUCP> <535@m10ux.UUCP> <560@taux01.UUCP> Reply-To: erja@saturn.UUCP (Erik Jacobsen) Organization: DAIMI: Computer Science Department, Aarhus University, Denmark Lines: 29 Keywords: NEW, DISPOSE, ALLOCATE, DEALLOCATE The NEW/DISPOSE-procedures in MODULA-2 are special in the sense that they can't be written as normal procedures. The compiler translates statements with NEW/DISPOSE into appropriate calls to ALLOCATE/DEALLOCATE. ALLOCATE/DEALLOCATE must be available procedures, usually imported from Storage. A PASCAL-like write-procedure, with a variable number of parameters with different types, can't be written as a normal procedure. But in a similar way the compiler could change a statement like: write( some_cardinal , some_string , some_whatever) into calls to WriteCard, WriteString and WriteWhatever. (Some of these procedures have extra parameters that must be specified in some way.) This is in fact the way a PASCAL-compiler works, except the programmer can't decide which WriteWhatever-procedures to be used. A change like this seems to be close to the "spirit" of MODULA-2. Any comments? --------------------------------------------------------------------- Erik Jacobsen erja@daimi.dk Computer Science Department Phone: +45 6 12 71 88 ext. 5226 Aarhus University DK-8000 Aarhus, Denmark ---------------------------------------------------------------------