How to hide type internals
- From: "Gerd" <GerdM.O@xxxxxxxxxxx>
- Date: 30 Jun 2006 03:50:36 -0700
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;
.
- Follow-Ups:
- Re: How to hide type internals
- From: Alex R. Mosteo
- Re: How to hide type internals
- From: claude . simon
- Re: How to hide type internals
- Prev by Date: Re: Custom model in gtkada?
- Next by Date: Re: How to hide type internals
- Previous by thread: How To Learn About All The Different Packages
- Next by thread: Re: How to hide type internals
- Index(es):
Relevant Pages
|