comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: limited/non-limited in Ada95
Date: 1997/10/21
Date: 1997-10-21T00:00:00+00:00	[thread overview]
Message-ID: <EIFDy2.1uo@world.std.com> (raw)
In-Reply-To: JSA.97Oct20202120@alexandria.synquiry.com


In article <JSA.97Oct20202120@alexandria.synquiry.com>,
Jon S Anthony <jsa@alexandria.synquiry.com> wrote:
>In article <mheaney-ya023680001810971145040001@news.ni.net> mheaney@ni.net (Matthew Heaney) writes:
>> I agree that aliasing can comprimise the safely of a limited type (everyone
>> ought to read Baker's Limited Robbery paper), but if the programmer always
>> implements a limited private type by using a full view that is itself
>> limited - which one can do in Ada 95 - then there is no problem.
>
>There are important cases where this is at _best_ impractical and
>actually is more like not _feasible_.  The _view_ for the
>implementation should not (can _not_) have limited semantics.  This is
>particularly evident when you are constructing GC for Ada _within_ the
>language.  Since this is one of Henry's main baileywicks, and since
>I've constructed such a GC asset suite _within_ the language, I can
>very easily understand where he is coming from.  It's _painfully_
>obvious when you have to actually deal with the situation.

Well, the rest of the world hasn't seen your GC stuff.  At least I
haven't.  So I can't quite understand what you're getting at, here.
What's wrong with having:

    type T is limited private;

then:

    type T_Contents is ...; -- not limited!
    type T is
        limited record -- to keep Henry from stealing bank accounts ;-)
            Contents: T_Contents;
        end record;

Now clients see a by-reference (return-by-reference, even!) type T, but
the implementation of the package itself can do assignments via
X.Contents := Y.Contents.

?

>> If the programmer doesn't use a by-reference type, then it's a case of
>> programmer indolence, not a language problem.
>
>Rubbish.

Perhaps others more intelligent than I can understand what you're saying
here, but for me, a mere "Rubbish" isn't quite detailed enough for me to
understand your point.  Perhaps you would care to elaborate?  Maybe give
an example from your GC stuff?  I'd like to see an example illustrating
the problem, and perhaps even a suggestion as to how the rules of the
language ought to be changed.

Yes, I understand Henry's paper, but that was before "limited record"
existed.  (I read Henry's paper before Ada 9X existed, so if there's a
new version that talks about Ada 95, please tell me to go read it.)

- Bob




  reply	other threads:[~1997-10-21  0:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-13  0:00 limited/non-limited in Ada95 Tom Moran
1997-10-16  0:00 ` Matthew Heaney
1997-10-17  0:00   ` Jon S Anthony
1997-10-18  0:00     ` Matthew Heaney
1997-10-21  0:00       ` Jon S Anthony
1997-10-21  0:00         ` Robert A Duff [this message]
1997-10-22  0:00           ` Robert Dewar
1997-10-22  0:00             ` Jon S Anthony
1997-10-22  0:00           ` Jon S Anthony
1997-10-23  0:00             ` Fergus Henderson
1997-10-23  0:00               ` Jon S Anthony
1997-10-23  0:00               ` Jon S Anthony
1997-10-24  0:00                 ` Geert Bosch
1997-10-21  0:00         ` Robert Dewar
1997-10-21  0:00           ` Jon S Anthony
1997-10-22  0:00             ` Robert Dewar
1997-10-22  0:00               ` Jon S Anthony
1997-10-18  0:00     ` Tom Moran
1997-10-18  0:00       ` Matthew Heaney
1997-10-19  0:00         ` Tom Moran
1997-10-19  0:00           ` Matthew Heaney
1997-10-21  0:00             ` Tom Moran
1997-10-21  0:00               ` Matthew Heaney
1997-10-21  0:00         ` Robert A Duff
1997-10-21  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