comp.lang.ada
 help / color / mirror / Atom feed
From: steve@dim.sm.unisys.com (Steven Holtsberg)
Subject: Re: Implicit conversion?
Date: 13 Mar 89 22:31:53 GMT	[thread overview]
Message-ID: <5737@sdcrdcf.sm.unisys.com> (raw)
In-Reply-To: 46125@linus.UUCP


In article <46125@linus.UUCP> eachus@mbunix.mitre.org (Robert I. Eachus) writes:
>>procedure example is
>>  x: tiny_integer;
>>begin
>>  x:= MAX_INT - MAX_INT;
>>end example;
|
|     ... there is an implicit conversion of MAX_INT to tiny_integer.
|
|      ... but it is not converting the result to zero, it is using
| the "-" operator for tiny_integer and doing the conversion first.
| This is legal, and must be legal, on all implementations.  However,
| it may raise an exception during execution.  The reason Verdix
| doesn't raise CONSTRAINT_ERROR or NUMERIC_ERROR is more subtile.

I do not see how MAX_INT, (2147483647 in this implementation) can be
converted to TINY_INTEGER (-128 .. 127).  I believe that
the "-" operator for TINY_INTEGER is doing what 11.6(6) allows it to do,
that is, "...use the operation of a type that has a range wider that that of
the base type of the operands..."

| In 11.6(3) (but read
| all of 11.6) "...freedom is left to an implementation for reordering
| actions...that are...basic operations other than assignments.  This
| freedom is left, as defined below, even where the execution...may
| propagate a predefined exception."

I don't understand what freedom to reorder actions has to do with this example.

  reply	other threads:[~1989-03-13 22:31 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 [this message]
1989-03-09 15:40 ` stt
1989-03-17 18:11   ` Roger Racine
1989-03-18  9:46     ` Steven Holtsberg
replies disabled

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