comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: "out" or "access"
Date: 1998/10/29
Date: 1998-10-29T00:00:00+00:00	[thread overview]
Message-ID: <wcc3e87hrl8.fsf@world.std.com> (raw)
In-Reply-To: m37lxk4890.fsf@mheaney.ni.net

Matthew Heaney <matthew_heaney@acm.org> writes:

> Agreed.  It only adds syntactic overhead, with no added value.  Worse,
> it makes you not pay attention to those type casts that really do
> matter.

Yes.  The boy who cried "wolf".

> Not having access constant parameters tends to cause a ripple effect,
> ...

I agree with your points.

But how about this workaround: declare New_Iterator to take an 'in'
parameter of type Root_Queue.  (Presuming you really do want an iterator
that can't modify the thing it's iterating over.)  So it's dispatching,
which you want.  Inside the various overridings of it, you will normally
have to do 'Unchecked_Access to produce a pointer to the thing, which
you would presumably store inside the iterator object.  This works
because all tagged parameters are aliased.  It's slightly ugly, and
slightly unsafe, but at least it's fairly localized.  You do have to
warn your clients that they had better not let an iterator live longer
that what it's iterating over.

Don't you agree that this workaround is better than the ones that cause
those nasty ripple effects?

> We need access constant parameters.

Well, we at least *want* them.

- Bob
-- 
Change robert to bob to get my real email address.  Sorry.




  reply	other threads:[~1998-10-29  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-21  0:00 "out" or "access" =:-) Vincent
1998-10-21  0:00 ` Tucker Taft
1998-10-22  0:00   ` Pascal Obry
1998-10-29  0:00     ` Robert A Duff
1998-10-29  0:00       ` Matthew Heaney
1998-10-29  0:00         ` Robert A Duff [this message]
1998-10-30  0:00           ` dennison
1998-10-30  0:00             ` Matthew Heaney
1998-10-30  0:00               ` Robert A Duff
1998-10-31  0:00                 ` dewar
1998-10-31  0:00                   ` Matthew Heaney
1998-10-31  0:00                 ` Matthew Heaney
1998-11-01  0:00                   ` Robert A Duff
1998-11-01  0:00                     ` Matthew Heaney
1998-11-01  0:00                       ` Robert A Duff
1998-11-02  0:00                         ` Matthew Heaney
1998-11-03  0:00                           ` Simon Wright
1998-11-16  0:00                             ` Matthew Heaney
1998-10-21  0:00 ` dennison
1998-10-21  0:00 ` Jeff Carter
1998-10-21  0:00   ` Pat Rogers
1998-10-21  0:00     ` Martin C. Carlisle
1998-10-22  0:00       ` Pat Rogers
1998-10-22  0:00     ` Robert A Duff
replies disabled

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