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 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles; site gypsy.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!siemens!gypsy!rosen From: rosen@gypsy.UUCP Newsgroups: net.lang.ada Subject: Ambiguous use of dereference in Ada Message-ID: <38000019@gypsy.UUCP> Date: Mon, 22-Jul-85 10:06:00 EDT Article-I.D.: gypsy.38000019 Posted: Mon Jul 22 10:06:00 1985 Date-Received: Wed, 24-Jul-85 23:37:50 EDT Nf-ID: #N:gypsy:38000019:000:1466 Nf-From: gypsy!rosen Jul 22 10:06:00 1985 List-Id: I have noted an unusually item while writting some Ada code. This strange item involved the dereference operator 'all' for use with access types. See the following piece of code: -------------------------------------------------------------- procedure weird_ptrs is type stupid is record a: integer; b: float; end record; type stupid_ptr is access stupid; c1, c2: integer; xxx: stupid_ptr; begin xxx := new stupid'(a => 100, b => 3.1415); c1 := xxx.a; --1-- c2 := xxx.all.a; --2-- end weird_ptrs; --------------------------------------------------------------------------- The compiler (Verdix 4.02) does not complain about lines --1-- and --2--. Actually they appear to be exactly the same. In --1-- the dereference operation is implicit while in --2-- the deference operation is performed through the 'all' operator. I find this to be extremely strange even thought I can accept both methods. What bothers me is that the LRM is very vague about mentioning any difference between these two methods. This certainly can be very confusing when reading code. Does anybody have any thoughts on why this is? I don't believe it is a bug, but please let me know if there is a compiler that has something to say about this. Steve Rosen Siemens Research and Technology Laboratories Princeton, NJ USENET: {ihnp4|princeton|adrvax}!siemens!rosen ARPA: princeton!siemens!rosen@TOPAZ