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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c3a7c1845ec5caf9 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Equality operator overloading in ADA 83 Date: 1997/04/28 Message-ID: #1/1 X-Deja-AN: 237973974 Distribution: world References: <01bc4e9b$ac0e7fa0$72041dc2@lightning> <33692089.5794807@news.airmail.net> Organization: The Mitre Corp., Bedford, MA. Newsgroups: comp.lang.ada Date: 1997-04-28T00:00:00+00:00 List-Id: In article jsa@alexandria (Jon S Anthony) writes: > I strongly agree with this. Of course (as you all know by now) I > would go further and say that GC is really the only good solution > here. Even if it were only for strings. Finalization and user > defined assignment are typically going to be rather more expensive. The cost of finalization and user defined assignment are implementation concerns. But in what sense is Ada.Strings.Unbounded not exactly the "Even if it were only for strings," functionality? Robert Dewar said: > What I think would be a nice compromise is to have a storage pool > specially for unbounded strings (or similar gizmos) where you got > GC in that storage pool -- something to keep looking at ... This is definitely an area where the language can and should evolve. Ada.Strings.Unbounded is a nice package to have, but a generic which exported a Garbage_Collected type would be even more useful in places: generic type Data(<>) is private; type Reference is access all Data; package Garbage_Collected is type Collected is private; function Create(Contents: in Data) return Collected; function Get_Ref(Item: in Collected) return Reference; function Contents(Item: in Collected) return Data; private -- implementation defined end Garbage_Collected; If done right, Get_Ref would probably be a type conversion... -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...