🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #4878

Re: MetCom (IT'S A WARNING!!!!)

#4878
From: Rick Sutcliffe
Date: Wed, 13 Dec 1989 18:18
21 lines
1066 bytes
In article <"89-12-11-21:03:38.02*UK4H"@DKAUNI2.BITNET>, UK4H@DKAUNI2.BITNET (JAE) writes:
> Bob Campbell wrote:
> > NEW is ALLOCATE(x,SIZE(x))
> > DISPOSE is DEALLOCATE(x,SIZE(x))
> THIS IS WRONG!!!!
> Instead you have to write
>   ALLOCATE(x,SIZE(x^));
>   DEALLOCATE(x,SIZE(x^));

Actually, its still not right.  It is inadvisable to say the least to do
SIZE(x^) before the ALLOCATE has been done. What if x is NIL?
Do it this way:
TYPE
  MyThingy = whatever;
  MyPoint = POINTER TO MyThingy;
VAR
  x: MyPoint;

ALLOCATE (x, SIZE (MyThingy))

Rick Sutcliffe
Technical Details
Message-ID: <172@fornax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!zephyr.ens.tek.com!uw-beaver!ubc-cs!fornax!rsutc
References: <"89-12-11-21:03:38.02*UK4H"@DKAUNI2.BITNET>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!zephyr.ens.tek.com!uw-beaver!ubc-cs!fornax!rsutc
From: rsutc@fornax.UUCP (Rick Sutcliffe)
Newsgroups: comp.lang.modula2
Subject: Re: MetCom (IT'S A WARNING!!!!)
Summary: No, thats not quite right either
Message-ID: <172@fornax.UUCP>
Date: 13 Dec 89 18:18:09 GMT
References: <"89-12-11-21:03:38.02*UK4H"@DKAUNI2.BITNET>
Organization: School of Computing Science, SFU, Burnaby, B.C. Canada
Lines: 21