From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 21 Apr 92 19:52:08 GMT From: elroy.jpl.nasa.gov!usc!zaphod.mps.ohio-state.edu!ub!dsinc!netnews.upenn.e du!uofs!guinness.cs.uofs.edu!beidler@lll-winken.llnl.gov (Jack Beidler) Subject: Re: Access types and ALL Message-ID: <10687@platypus.uofs.uofs.edu> List-Id: In article <1992Apr14.204743.19499@u.washington.edu>, mfeldman@milton.u.washing ton.edu (Michael Feldman) writes: Mike presents the following example, |> Given a record type |> |> TYPE R IS RECORD |> ... |> F: Some_Type := Some_Value; |> ... |> |> END RECORD; |> |> and an access type |> |> TYPE R_Ptr IS ACCESS R; |> |> ... |> |> RP : R_Ptr := NEW R; |> |> we can apparently select the field F in two ways: |> |> (1) RP.F |> |> (2) RP.ALL.F |> I wonder to what extent this anomoly is due to the desire of the language desig ners to make some of Ada not look like Pascal, resulting in the decision not to use the '^' to distinguish between an access variable and the object pointeed to by the acc ess variable. Once the '^' disappeared, the need for ".all" arise. To illustrate, if RP, QP : R_Ptr ; then [in Ada] [in Pascal] QP := RP ; -- copy the access variable value QP := R P ; QP.all := RP.all ; -- copy the object being pointed to QP^ := R P^ ; QP.all.F := RP.F -- looks like a mistake QP^.F := R P^.F ; Since were stuck with Mike's anomoly, I guess we need a style rule, like "only use .all when you really have to!?". ".all" things considered, I'll stil l take Ada. -- +-----------------------------------------------------------------------------+ | John (Jack) Beidler | | Prof. of Computer Science Internet (VAX/VMS) BEIDLER@JAGUAR.UOFS.ED | | University of Scranton Internet (SUN/UNIX) BEIDLER@GUINNESS.CS.UOFS.EDU| | Scranton, PA 18510 Bitnet (VAX/VMS) BEIDLER@SCRANTON | | | | Phone: (717) 941-7446 FAX: (717) 941-4250 | +-----------------------------------------------------------------------------+