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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,100eb0a59892e906 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!u65g2000hsc.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: How to pass around access types to interfaces? Date: Tue, 28 Oct 2008 06:41:55 -0700 (PDT) Organization: http://groups.google.com Message-ID: <8bd7e8eb-b463-4dea-8b62-42b6486557f0@u65g2000hsc.googlegroups.com> References: NNTP-Posting-Host: 128.141.45.238 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1225201317 28863 127.0.0.1 (28 Oct 2008 13:41:57 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 28 Oct 2008 13:41:57 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u65g2000hsc.googlegroups.com; posting-host=128.141.45.238; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.3) Gecko/2008092414 Firefox/3.0.3,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:2511 Date: 2008-10-28T06:41:55-07:00 List-Id: On 26 Pa=BC, 16:50, "Martin Krischik" wrote: > But then: access to class wide is the kind of =A0 > access which a C++ convert will uses without realy needing them. I should= =A0 > know, I am a C++ convert who made precisely that mistake. It might depend on what you did in C++ before converting. ;-) Since most of the code does not need pointers anyway, the frequent idiom is to pass objects by reference (likely to the base class), something like: void foo(const SomeClass & object); I don't see how moving this to Ada can lead one to use pointers - personally, I find "in Some_Type'Class" to be very natural. No pointers needed. I think that in the above context what is *really* dangerous and difficult to clean up is the C background, not C++. Unfortunately the former one prevails. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com Database Access Library for Ada: www.inspirel.com/soci-ada