Newsgroups: comp.lang.modula2
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!ox.com!math.fu-berlin.de!fauern!ira.uka.de!rusmv1!theorie!laborix!borchert
From: borchert@laborix.mathematik.uni-ulm.de (Andreas Borchert)
Subject: Re: How to write NEW?
Message-ID: <1991May1.122959.3716@informatik.uni-ulm.de>
Sender: usenet@informatik.uni-ulm.de (Name for nntp-posting)
Nntp-Posting-Host: laborix.mathematik.uni-ulm.de
Reply-To: borchert@laborix.mathematik.uni-ulm.de (Andreas Borchert)
Organization: University of Ulm, SAI, Germany
References: <1991Apr22.155056.10010@cc.newcastle.edu.au> <14627@encore.Encore.COM>
Date: Wed, 1 May 91 12:29:59 GMT
Lines: 25

In article <14627@encore.Encore.COM>, soper@encore.UUCP (Pete Soper,Cary NC,9194813730,9193624635) writes:
|> From article <1991Apr22.155056.10010@cc.newcastle.edu.au>, by eepjm@cc.newcastle.edu.au:
|> > 
|> > The answer is actually quite simple, it's only the documentation that's
|> > bad.  EVERY Modula-2 compiler supports NEW and DISPOSE (if you find one
|> > that doesn't, you've been cheated) in the following way.  When NEW(Var)
|> 
|>   There are lots of cheated folks out there in that case. Compilers
|> implementing the language described by edition three of the Wirth book do not
|> contain NEW and DISPOSE. This is another case where Wirth fiddled with the
[...]

Wirth declares NEW in the 3rd edition to be optional. Chapter 21, p. 76:

"In some implementations, the statement Allocate(p0, SIZE(Node)) can
be abbreviated as NEW(p0)."

In fact, nearly every Modula-2 compiler accepts NEW and DISPOSE.
Further, NEW & DISPOSE are expected to be part of the coming standard.

-- 
Andreas Borchert        |   Internet: borchert@mathematik.uni-ulm.de
Universitaet Ulm, SAI   |             postmaster@uni-ulm.de
Oberer Eselsberg        |   Bitnet:   borchert@dulruu51.bitnet
D-7900 Ulm, Germany     |   X.400:    S=borchert; OU=rz; P=uni-ulm; A=dbp; C=de
