Article View: comp.lang.modula2
Article #1978Re: How to write NEW? (A solution)
From: Warwick Allison
Date: Mon, 22 Apr 1991 07:41
Date: Mon, 22 Apr 1991 07:41
20 lines
998 bytes
998 bytes
Use the C preprocessor.
#define NEW(p) ALLOCATE(p,SIZE(p^))
That, I think is the only solution, unless you want to change NEW to
use it as NEW(a,a^), in which case just implement:
PROCEDURE NEW(VAR a:ADDRESS; VAR adata:ARRAY OF BYTE);
and hope that you compiler will not actually dereference a to get a^ since
it does not actually need to know the data.
How about that for an ugly kludge?
Warwick.
--
_-_|\ warwick@cs.uq.oz.au
/ * <-- Computer Science Department,
\_.-._/ University of Queensland,
v Brisbane, AUSTRALIA.
Technical Details
Message-ID:
<937@uqcspe.cs.uq.oz.au>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!spool.mu.edu!munnari.oz.au!brolga!uqcspe!cs.uq.oz.au!warwickReferences:
<5122672@janhh.hanse.de>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!spool.mu.edu!munnari.oz.au!brolga!uqcspe!cs.uq.oz.au!warwick From: warwick@cs.uq.oz.au (Warwick Allison) Newsgroups: comp.lang.modula2 Subject: Re: How to write NEW? (A solution) Message-ID: <937@uqcspe.cs.uq.oz.au> Date: 22 Apr 91 07:41:53 GMT References: <5122672@janhh.hanse.de> Sender: news@cs.uq.oz.au Reply-To: warwick@cs.uq.oz.au Lines: 20