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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,66253344eaef63db X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,66253344eaef63db X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,66253344eaef63db X-Google-Attributes: gid1108a1,public X-Google-ArrivalTime: 1994-10-02 19:04:14 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!MathWorks.Com!panix!cmcl2!thecourier.cims.nyu.edu!thecourier.cims.nyu.edu!nobody From: comar@cs.nyu.edu (Cyrille Comar) Newsgroups: comp.lang.ada,comp.object,comp.lang.c++ Subject: Re: Mut. Recurs. in Ada9X w/o Breaking Encaps.? (LONG) Date: 2 Oct 1994 20:33:59 -0400 Organization: Courant Institute of Mathematical Sciences Message-ID: <36njhn$o7e@lang8.cs.nyu.edu> References: <1994Sep29.014611.20263@swlvx2.msd.ray.com> NNTP-Posting-Host: lang8.cs.nyu.edu Xref: bga.com comp.lang.ada:6385 comp.object:6991 comp.lang.c++:31410 Date: 1994-10-02T20:33:59-04:00 List-Id: jgv@swl.msd.ray.com (John Volan) writes: : can the client do with that pointer? As far as it can see, the Office object : being pointed to is totally featureless. Oh, sure, it's possible that this :Office object is really some subclass of Abstract_Office that does have useful : features, but this information isn't available to the client.The only way the : client could get to that information would be to use an unchecked conversion : to change this "opaque" pointer into a pointer to the "non-opaque" Office : subclass below. (I think folks in the other languages would call this : "downcasting".) But this practice breaks type-safety! As far as I know, downcasting is allowed in Ada9x and is type-safe (a check is performed at run-time) by using a regular conversion not an unchecked-conversion, so Mark's solution seems very close to what you need. -- ------------------------------------------------------------------------ Cyrille Comar, E-mail: comar@cs.nyu.edu Gnat Project US phone: (212) 998-3489