From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3d9acd0750841603,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!d56g2000cwd.googlegroups.com!not-for-mail From: "Gerd" Newsgroups: comp.lang.ada Subject: How to hide type internals Date: 30 Jun 2006 03:50:36 -0700 Organization: http://groups.google.com Message-ID: <1151664636.528401.15590@d56g2000cwd.googlegroups.com> NNTP-Posting-Host: 62.159.113.204 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1151664640 26936 127.0.0.1 (30 Jun 2006 10:50:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 30 Jun 2006 10:50:40 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: d56g2000cwd.googlegroups.com; posting-host=62.159.113.204; posting-account=_FaVAg0AAAAYUPoPAQYNRFF35JBHf9i7 Xref: g2news2.google.com comp.lang.ada:5329 Date: 2006-06-30T03:50:36-07:00 List-Id: 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;