Path: utzoo!utgpu!watmath!clyde!att!rutgers!mailrus!cornell!uw-beaver!ssc-vax!shuksan!scott
From: scott@shuksan.UUCP (Scott Moody)
Newsgroups: comp.lang.ada
Subject: opaque types/information hiding
Summary: interesting feature
Message-ID: <992@shuksan.UUCP>
Date: 28 Nov 88 22:00:17 GMT
Organization: The Boeing Co., BAC MMST, Seattle, WA
Lines: 39

About a year ago I found out a neat feature of package specs and
private types that I didn't know before, and only found out
by reading the fine print.

If a private type is a pointer to something, then the declaration
of that something doesn't have to be included in the spec,  but 
can be differed to the body. The compiler knowns from the spec
that a pointer is used so it knows how big y will be. This way 
real information hiding is achieved (versus showing what it is but
not letting them touch it).

(Unfortunately Verdix (year ago) had a bug with 
the implementation but that is another story ...)

*****
e.g. 

   package  X is
      type y is limited private;

      procedure something(arg:y);
   
   private
      type y_rec;

      type y is access y_real;
   end X;
   -------------------------------
   package body X is

      type y_rec is record ... end;

      ...

   end X;

*****

Just thought someone might like it ...