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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,2f84446733b06aca X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,2f84446733b06aca X-Google-Attributes: gid103376,public From: jsa@alexandria (Jon S Anthony) Subject: Re: Converting C++ class to Ada Date: 1996/12/12 Message-ID: #1/1 X-Deja-AN: 203786662 sender: news@organon.com (news) references: <32ADF183.7195@lmtas.lmco.com> <32AF3A52.1340@watson.ibm.com> organization: Organon Motives, Inc. newsgroups: comp.lang.ada,comp.lang.c++ Date: 1996-12-12T00:00:00+00:00 List-Id: In article <32AF3A52.1340@watson.ibm.com> "Norman H. Cohen" writes: > type Object_Type (<>) is limited private; > type Reference_Type is access Object_Type; > function New_Object (...) return Reference_Type; > > Outside of its defining package, Object_Type is indefinite, so an object > of the type can only be created if an initial value is specified for it > (in an object declaration or allocator), but Object_Type is also > limited, so no initial value can be specified for an object of this > type! In other words, an Object_Type object cannot be declared or > allocated outside its defining package. The corresponding full type > need not be either limited or indefinite, so inside the package body you ^^^^^^^^^^^^^^^^^^^^^^^^^^ > are free to allocate objects of the type and return the resulting access > values to the caller. (Another example of this approach can be found on > pages 489-490 of Ada as a Second Language.) Note that this is _not_ true if the type is tagged... /Jon -- Jon Anthony Organon Motives, Inc. Belmont, MA 02178 617.484.3383 jsa@organon.com