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,40db5229aec061c0 X-Google-Attributes: gid103376,public From: "Terry J. Westley" Subject: Re: access to controlled types Date: 1999/02/05 Message-ID: <918223958.430528@outpost1.roc.accglobal.net>#1/1 X-Deja-AN: 440997482 Cache-Post-Path: outpost1.roc.accglobal.net!unknown@worf-gw.calspan.com References: <918079635.219550@outpost1.roc.accglobal.net> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800 Organization: Calspan/Veridian X-MSMail-Priority: Normal Reply-To: "Terry J. Westley" Newsgroups: comp.lang.ada Date: 1999-02-05T00:00:00+00:00 List-Id: >"Terry J. Westley" writes: > >> In a new version of TASH, I've implmented an interface >> to Tcl objects (which are reference counted) with Ada >> controlled types. I've been very impressed with how >> well this works in GNAT. >> >> But, there are certain calls in the interface which >> return an access to a class-wide type. It's easy to >> reference count these newly created objects, but since >> the access type is not controlled, the reference counts >> don't get decremented. What's the solution? Should I >> declare another controlled type which *contains* an >> access to the original controlled type? Or, is there >> a better solution? > Stephen Leake responds: >Perhaps the functions that return a class-wide access type should >simply be removed. Do they serve a real purpose in the system? Is >there another (safer) way to satisfy that need? I guess the latter is >what you are suggesting. But often, a function that violates an >abstraction truly does not belong. You have a good point. I'll think about it a bit. The specific situation is that TASH supports Tcl lists which are heterogenous. So, when you fetch an element out of the list, it could be an integer, a float, a string, or another list. Other functions that return an element of the list are Head and Tail. -- Terry J. Westley, Principal Engineer Veridian Engineering, Calspan Operations twestley@buffalo.veridian.com http://www.veridian.com/ ------------------------------------------------------- Author of TASH, an Ada binding to Tcl/Tk. Visit the TASH web site at http://tash.calspan.com. -------------------------------------------------------