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: 103376,751584f55705ddb7 X-Google-Attributes: gid103376,public From: John G. Volan Subject: Re: Side-effect arithmetic again [was: Ada ... in embedded systems] Date: 1996/03/29 Message-ID: <4jgllm$81b@dayuc.dayton.saic.com>#1/1 X-Deja-AN: 144857136 distribution: world references: <4iq2ia$lk7@dayuc.dayton.saic.com> <4jchbi$ep0@dayuc.dayton.saic.com> content-type: text/plain; charset=ISO-8859-1 x-xxmessage-id: organization: Science Applications International Corp. (SAIC) mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-03-29T00:00:00+00:00 List-Id: In article Tucker Taft, stt@henning.camb.inmet.com writes: >John G. Volan (John_Volan@ccmail.dayton.saic.com) wrote: >: In article Robert Dewar, dewar@cs.nyu.edu writes: >: >Well I can't get particularly upset by that , but if you are, just >: >change this to Item'Val (Item'Pos(This) + Positive'Pos (By)). > >: Okay, that leaves the exact type returned by the 'Pos functions >: ambiguous, but what does Ada95 do in that case? [snip] > >The 'Pos attribute returns a value of type universal_integer, >which is implicitly convertible to any integer type. Given that >you are adding it to a value of subtype Positive, it will be >converted to Integer (since Positive is a subtype of Integer). Yes, that's clearly the case for: Item'Val (Item'Pos(This) + By) ^^^^^^^^^^^^^^ ^^ univeral integer Standard.Positive but that wasn't what I was asking. I was referring to Robert Dewar's suggestion: Item'Val (Item'Pos(This) + Positive'Pos(By)) ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ univeral integer universal integer I assume that both of these must be converted to some actual integer type before being added together and passed in to Item'Val. But which integer type? ------------------------------------------------------------------------ Internet.Usenet.Put_Signature ( Name => "John G. Volan", E_Mail => "John_Volan@dayton.saic.com", Favorite_Slogan => "Ada95: The *FIRST* International-Standard OOPL", Humorous_Disclaimer => "These opinions are undefined by SAIC, so" & "any use would be erroneous ... or is that a bounded error now?" ); ------------------------------------------------------------------------