Xref: utzoo comp.lang.modula2:783 comp.lang.misc:1446 Path: utzoo!utgpu!water!watmath!clyde!att-cb!osu-cis!tut.cis.ohio-state.edu!rutgers!iuvax!pur-ee!pur-phy!hal From: hal@pur-phy (Hal Chambers) Newsgroups: comp.lang.modula2,comp.lang.misc Subject: Re: Modula2's godawful IO. Keywords: NEW, DISPOSE, ALLOCATE, DEALLOCATE Message-ID: <1108@pur-phy> Date: 15 Apr 88 12:19:50 GMT References: <764@ndsuvax.UUCP> <535@m10ux.UUCP> <560@taux01.UUCP> <1418@daimi.UUCP> Reply-To: hal@newton.physics.purdue.edu.UUCP (Hal Chambers) Organization: Purdue Univ. Physics Dept., W. Lafayette, IN Lines: 29 In article <1418@daimi.UUCP> erja@saturn.UUCP (Erik Jacobsen) writes: >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. But you can write your own ALLOCATE/DEALLOCATE. >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.) >A change like this seems to be close to the "spirit" of MODULA-2. >Any comments? I agree. Most of the complaints I've seen about IO in Modula-2 can be rectified by writing your own IO module. At least M2 LETS you write your own routines! I wrote something in the spirit of Software Tools for my own IO package. Hal Chambers