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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2f84446733b06aca X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: Converting C++ class to Ada Date: 1996/12/20 Message-ID: <32BAB8C8.7046@gsfc.nasa.gov>#1/1 X-Deja-AN: 205118250 references: <32ADF183.7195@lmtas.lmco.com> <32B05137.733A@lmtas.lmco.com> content-type: text/plain; charset=us-ascii organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA mime-version: 1.0 reply-to: Stephen.Leake@gsfc.nasa.gov newsgroups: comp.lang.ada x-mailer: Mozilla 3.0 (Win95; U) Date: 1996-12-20T00:00:00+00:00 List-Id: Robert A Duff wrote: > > In article , > Jon S Anthony wrote: > >> Also, if I wanted to make sure that "null" wasn't used as one of the > >> discriminants, would I have to use "access Motor.Object_Type" rather > >> than the declared access type? > > > >Neither will prevent that. > > A value of an anonymous access type can never be null. (This includes > both access parameters and access discriminants.) Run-time checks > ensure this. > > - Bob I can't find a rule in the RM that says this. In "Ada as a Second Language", page 491, Norman Cohen says "Elaboration of a discriminant constraint raises the exception Constriant_Error if the value given for an access disciminant is null". So I believe an access discriminant cannot be null, but I'm trying to hone my RM reading skills. Searching for "access discriminant" gave no rule regarding null values. As Jon Anthony pointed out, 11.5, which lists ALL defined checks, does not mention checking access discriminants for null, only access parameters. So where is the rule? -- - Stephe