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!osu-cis!tut.cis.ohio-state.edu!mailrus!cornell!batcomputer!itsgw!steinmetz!uunet!mcvax!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.lang.ada Subject: Deferring the definition of a private type to the body Message-ID: <4110@enea.se> Date: 26 Nov 88 22:35:32 GMT Organization: ENEA DATA AB, Sweden List-Id: Richard Pattis (pattis@june.cs.washington.edu) writes: > Finally, if I recall my Ada correctly, one can use access types in Ada to >implement private types that are equivalent to Modula-2's opaque types, at >least with regard to portability problems residing in package bodies. I >believe Cohen's book had a discussion of this use of access types in the >private parts of packages. Not that I have read the book, but it's that hard to find it out yourself. If you want to defer the implementation of your private type to the package body try the following: PACKAGE Nisse IS TYPE My_own IS PRIVATE; -- or LIMITED of you prefer. ... PRIVATE TYPE My_own_machine_dependent_implemtation; TYPE My_own IS ACCESS My_own_machine_dependent_implemtation; END Nisse; PACKAGE BODY Nisse IS TYPE My_own_machine_dependent_implemtation IS -- whatever you feel like. .... END Nisse; So those wanted this into the language are you satisfied? And can we who want the implementation being in the specification continue to do? Having a pointer for every small little integer or enumerate doesn't like a bright idea to me. -- Erland Sommarskog ENEA Data, Stockholm sommar@enea.se "Frequently, unexpected errors are entirely unpredictable" - Digital Equipment