Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!pa.dec.com!src.dec.com!src.dec.com!muller From: muller@src.dec.com (Eric Muller) Newsgroups: comp.lang.modula3 Subject: Re: Instance initialization in Modula-3? Message-ID: <1991Jan24.122222.9214@src.dec.com> Date: 24 Jan 91 20:22:22 GMT References: Sender: news@src.dec.com (News) Reply-To: muller@src.dec.com (Eric Muller) Organization: DEC Systems Research Center Lines: 19 In article , Bill Janssen asks: > When defining an OBJECT type in Modula-3, how does one specify the > initialization routine to be called from inside NEW? Modula-3 does not allow you to attach to an object type code to executed when an object of that type is created. The only thing you can do in the type declaration is to specify default initial values for the fields, which must be constant expressions, and default methods. > And is there any way to control allocation on a class basis, or > does NEW always create new objects on the heap? NEW always create new objects on the traced or untraced heap (depending on the object type). Eric Muller.