From: "Gerd" <GerdM.O@t-online.de>
Subject: How to hide type internals
Date: 30 Jun 2006 03:50:36 -0700
Date: 2006-06-30T03:50:36-07:00 [thread overview]
Message-ID: <1151664636.528401.15590@d56g2000cwd.googlegroups.com> (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;
next reply other threads:[~2006-06-30 10:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-30 10:50 Gerd [this message]
2006-06-30 11:19 ` How to hide type internals 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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox