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,772ae8afc5db35f2 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Can't export object of private type Date: 1999/03/01 Message-ID: #1/1 X-Deja-AN: 449709054 Sender: matt@mheaney.ni.net References: <7b6eq4$1tm0@news3.newsguy.com> NNTP-Posting-Date: Sun, 28 Feb 1999 17:41:29 PDT Newsgroups: comp.lang.ada Date: 1999-03-01T00:00:00+00:00 List-Id: nospam@thanks.com.au (Don Harrison) writes: > I guess I was aware of implicit dereferencing. What I didn't appreciate > was the value of combining it with formal access-parameters. I did this in my implementation of the Interpreter pattern, in the Oct 98 ACM patterns archives. You also use the technique to free objects designated by a pointer to a class-wide type. Most of my recent articles have been implemented this way (do a substring search for Do_Free). Interpreter WHY ACCESS PARAMETERS? All expression objects are referred to via an access object. Since there are only references to objects, all the primitive operations for the type take access T as the type. This way, the client doesn't have to say X.all everywhere -- she can invoke an operation by just using X directly. Smart Pointers I was able to simplify this example by using smart pointers, which provide automatic garbage collection. You can read all about it in the article "Smart Pointers," in the Feb 99 archive.