comp.lang.ada
 help / color / mirror / Atom feed
From: steve@sea.sm.unisys.com (Steven Holtsberg)
Subject: Re: Implicit conversion?
Date: 18 Mar 89 09:46:52 GMT	[thread overview]
Message-ID: <5742@sdcrdcf.sm.unisys.com> (raw)
In-Reply-To: 474@ajpo.sei.cmu.edu

In article <474@ajpo.sei.cmu.edu> rracine@ajpo.sei.cmu.edu (Roger Racine) writes:
>With respect to 
>
>X := MAX_INT - MAX_INT;
>
>Why would it be necessary to convert MAX_INT to anything?  There exists a
>predefined "-" operation which takes two universal_integers and returns
>universal_integer.  Then one is left with 
>
>X := 0;
>
>Implicit type conversion on the 0 works fine, and no errors occur.
>
I don't believe that an implicit type conversion can be performed on the 0.
Although a similar rule is not given for implicit type conversions, the
rule for explicit type conversions says that the "expression given as the
operand" is evaluated and the conversion is done on the "resulting value."
In this case, 0 is not an expression in this assignment statement; it is
the value of the expression MAX_INT - MAX_INT, which is not a convertible
universal operand.

Now, I assume the intent is that the operand of an implicit type conversion
must also be an expression.  However, the ARM does not explicitly state this
(no pun intended!).

What do the experts think?

      reply	other threads:[~1989-03-18  9:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5678@sdcrdcf.sm.unisys.com>
1989-03-08 16:38 ` Implicit conversion? Robert Eachus
1989-03-13 22:31   ` Steven Holtsberg
1989-03-09 15:40 ` stt
1989-03-17 18:11   ` Roger Racine
1989-03-18  9:46     ` Steven Holtsberg [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox