comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: How to pass around access types to interfaces?
Date: Tue, 28 Oct 2008 06:41:55 -0700 (PDT)
Date: 2008-10-28T06:41:55-07:00	[thread overview]
Message-ID: <8bd7e8eb-b463-4dea-8b62-42b6486557f0@u65g2000hsc.googlegroups.com> (raw)
In-Reply-To: op.ujm2apryz25lew@macpro.krischik.com

On 26 Paź, 16:50, "Martin Krischik" <krisc...@users.sourceforge.net>
wrote:

> But then: access to class wide is the kind of  
> access which a C++ convert will uses without realy needing them. I should  
> 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



  reply	other threads:[~2008-10-28 13:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-24 11:45 How to pass around access types to interfaces? Sven
2008-10-24 12:24 ` Niklas Holsti
2008-10-24 12:49   ` Sven
2008-10-24 13:55     ` Ludovic Brenta
2008-10-24 21:32 ` sjw
2008-10-25  8:54   ` Sven
2008-10-25 15:43 ` Martin Krischik
2008-10-25 22:15   ` Robert A Duff
2008-10-26  8:02     ` Dmitry A. Kazakov
2008-10-26 15:50     ` Martin Krischik
2008-10-28 13:41       ` Maciej Sobczak [this message]
2008-10-29 14:15         ` Martin Krischik
2008-10-31 13:38           ` Maciej Sobczak
2008-10-31 14:46             ` Dmitry A. Kazakov
2008-10-29 12:42   ` Sven
2008-10-29 13:17     ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox