Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!elroy.jpl.nasa.gov!ncar!hsdndev!husc6!encore!encore.UUCP From: soper@encore.UUCP (Pete Soper,Cary NC,9194813730,9193624635) Newsgroups: comp.lang.modula2 Subject: Re: How to write NEW? Message-ID: <14710@encore.Encore.COM> Date: 2 May 91 19:51:40 GMT References: <1991May1.122959.3716@informatik.uni-ulm.de> Sender: news@Encore.COM Lines: 34 Nntp-Posting-Host: maxzilla.encore.com From article <1991May1.122959.3716@informatik.uni-ulm.de>, by borchert@laborix.mathematik.uni-ulm.de (Andreas Borchert): > In article <14627@encore.Encore.COM>, soper@encore.UUCP (Pete Soper,Cary NC,9194813730,9193624635) writes: [ some omissions ] > |> 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. The first "3rd edition" single pass compiler (written by Wirth himself and others at ETHZ), did not implement NEW and DISPOSE. This compiler went out to the four corners of the globe and was the basis for compilers sold or given away in dozens of forms. Since the lack of NEW and DISPOSE was one of many ass-pains for folks moving code from "2nd edition" compiler environments it certainly makes sense that this was retrofitted commonly and so "nearly every Modula-2 compiler accepts NEW and DISPOSE". Folks implementing the 3rd edition language from scratch probably had backward compatibility in mind from the start and would tend to include this "option" without hesitation. I think we are approaching violent agreement about this subject so let's move on. Speaking of the coming standard, what was the final decision about forward declarations? That is, does the standard allow for single pass implementations or did they stand firm and reject this change which came with the 2nd edition/ 3rd edition transition? ----------------------------------------------------------------------- Pete Soper (soper@encore.com) +1 919 481 3730 Encore Computer Corp, 901 Kildaire Farm Rd, bldg D, Cary, NC 27511 USA