Article View: comp.lang.modula2
Article #4162Re: Modula2's godawful IO.
From: Erik Jacobsen
Date: Wed, 13 Apr 1988 11:21
Date: Wed, 13 Apr 1988 11:21
29 lines
1716 bytes
1716 bytes
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
---------------------------------------------------------------------
Technical Details
Message-ID:
<1418@daimi.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!mcvax!diku!dkuug!daimi!erjaReferences:
<764@ndsuvax.UUCP> <535@m10ux.UUCP> <560@taux01.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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