comp.lang.ada
 help / color / mirror / Atom feed
From: John English <je@brighton.ac.uk>
Subject: Re: PRIVATE abstract data type in ADS
Date: Wed, 30 Oct 2002 13:24:27 +0000
Date: 2002-10-30T13:23:45+00:00	[thread overview]
Message-ID: <3DBFDD8B.7EC8EA6F@brighton.ac.uk> (raw)
In-Reply-To: mailman.1035582781.21803.comp.lang.ada@ada.eu.org

Dominic D'Apice wrote:
> 
> Hi, in this abstract data type in ADS (see below), do i need to put
> 
> "type louer is access reservation" with the "IS PRIVATE" ?
> 
> If no, why i don't need to put "IS PRIVATE" after a access type when i
> want to keep it PRIVATE ?

If you had "type Lower is private" in the visible part of the package,
the only things you could do with a Lower are assignment and equality
testing (plus operations involving Lower defined in the visible part
of the package). You couldn't do any of these things:
  L : Lower := new Reservation;
  R : Reservation := L.all;
If you want package clients to be able to do this sort of thing, Lower
has to be visibly an access type. So in the end, it's up to you to
decide what you want to allow your clients to do with Lower objects...

-----------------------------------------------------------------
 John English              | mailto:je@brighton.ac.uk
 Senior Lecturer           | http://www.it.bton.ac.uk/staff/je
 Dept. of Computing        | ** NON-PROFIT CD FOR CS STUDENTS **
 University of Brighton    |    -- see http://burks.bton.ac.uk
-----------------------------------------------------------------



      parent reply	other threads:[~2002-10-30 13:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-25 21:52 PRIVATE abstract data type in ADS Dominic D'Apice
2002-10-26  9:11 ` Pascal Obry
2002-10-30 13:24 ` John English [this message]
replies disabled

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