From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3498dd887729ed19 X-Google-Attributes: gid103376,public From: rogoff@sccm.Stanford.EDU (Brian Rogoff) Subject: Re: Garbage Collection in Ada Date: 1996/11/06 Message-ID: #1/1 X-Deja-AN: 195204420 references: <01bbc6a3$4cf03480$829d6482@joy.ericsson.se> organization: /u/rogoff/.organization reply-to: rogoff@sccm.stanford.edu newsgroups: comp.lang.ada Date: 1996-11-06T00:00:00+00:00 List-Id: "Norman H. Cohen" writes: Robert A Duff wrote: > In article , > Matthew Heaney wrote: > >Language designers: any reason why overloading "all" would be too hard? > > Well, functions return values (or constant objects, if you want to be > precise in Ada 95 terms), whereas "P.all" returns a variable (if P is an > access-to-variable type). So it wouldn't work. The same scheme that Ada 95 uses to allow programmers to redefine the behavior of "new" could have been used to allow redefinition of the behavior of ".all". The type System.Storage_Pools.Root_Storage_Pool could have been given another primitive operation to be overridden by those defining their own storage-pool types: procedure Dereference (Pool : in out Root_Storage_Pool; Storage_Address : in out Address; Storage_Size_In_Elements : in Storage_Elements.Storage_Count; Alignment : in Storage_Elements.Storage_Count); This looks almost exactly like a proposal I read (a long time ago, on a web page long since forgotten) for adding persistence to Ada 95. The main difference is that Storage_Address was of type "Access_Type", which was a generic formal parameter to the Storage_Pools package, and another parameter to Dereference was a System.Address type. There was also a Rereference procedure for converting System.Address types back to Access_Types. <... snipping description of some the things this might allow ...> This seems, at first naive glance, to provide all of the hooks to do GC and more, in a very Ada-like way. The idea seems to have been around for a while too, perhaps hundreds of web-years (at least 10 months). So what are the drawbacks? -- Brian