comp.lang.ada
 help / color / mirror / Atom feed
* How to hide type internals
@ 2006-06-30 10:50 Gerd
  2006-06-30 11:19 ` claude.simon
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Gerd @ 2006-06-30 10:50 UTC (permalink / raw)


Hi,

I would like to write a package that exports functions using a special
type, without showing the details in the spec (even not in the private
part).
In Modula-2 one can declare opaque types (which mostly are pointers but
also can be any type of word size).

Like this:

package keys is
  type key;
  function GetKey return key;
  procedure FetchElement (k : key);
-- implementation of key not visible here
end keys;

package body keys
 ...
  type Data is record
                     ...
                    end record;
  type key is access Data;
...
end keys;




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-07-04 11:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-30 10:50 How to hide type internals Gerd
2006-06-30 11:19 ` claude.simon
2006-07-04 11:13   ` Gerd
2006-06-30 11:26 ` Alex R. Mosteo
2006-07-02 15:23 ` Stephen Leake
2006-07-04 11:11   ` Gerd

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