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: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Side-effect arithmetic again [was: Ada ... in embedded systems] Date: 1996/03/28 Message-ID: #1/1 X-Deja-AN: 144760703 references: <4jcgk6$eeo@dayuc.dayton.saic.com> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-03-28T00:00:00+00:00 List-Id: Robert/John/Tuck said ": >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? Does it just default : to Standard.Integer anyway? (In that case, your answer doesn't really : solve the problem.) Or can the compiler pick an integer type that's big : enough? Or does this simply cause a compilation error? 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). See RM95 3.5.5(4), 8.6(24), 6.4.1(11)." Sorry Tuck, I don't see this, I am adding two universal integer types here seems clear to me that this addition is done in universal integer, i.e. the longest possible integer type at runtime, and then converted to Item type. Please enlighten me as to why you feel otherwise, I don't see any "value of subtype Postive" in my expression!