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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 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 List-Id: 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 ...