From: Martin Dowie <martin.dowie@btopenworld.com>
Subject: Re: Various Language Architecture Questions
Date: Sun, 25 Sep 2005 07:24:04 +0000 (UTC)
Date: 2005-09-25T07:24:04+00:00 [thread overview]
Message-ID: <dh5jak$893$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com> (raw)
In-Reply-To: <1127624825.425796.61240@g43g2000cwa.googlegroups.com>
jimmaureenrogers@worldnet.att.net wrote:
> Typecasting is not a way of life for Ada. It is somewhat unusual.
> Ada access types (similar to references in Java) cannot be cast
> from one type to another. Ada uses Unchecked_Conversion for that
> purpose.
You would have to ensure that the underlying representation of each
access type was the same - Ada does not require that all access types be
a simple address. Alternatively, you could use
System.Address_To_Access_Conversions.
But the main point is that in Ada you have to be explicit and it is easy
to spot these 'dangerous' behaviors.
> You cannot coerce a real number type to or from an integer number
> type.
Are you sure about that Jim? :-)
declare
I : Integer := 10;
F : Float := 1.0;
begin
F := Float (I);
I := Integer (F);
end;
Or did you mean something else by 'coerce'?
Cheers
-- Martin
next prev parent reply other threads:[~2005-09-25 7:24 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-25 2:37 Various Language Architecture Questions frankgerlach
2005-09-25 5:07 ` jimmaureenrogers
2005-09-25 7:24 ` Martin Dowie [this message]
2005-09-25 8:17 ` Martin Krischik
2005-09-25 8:53 ` Dmitry A. Kazakov
2005-09-25 12:56 ` frankgerlach
2005-09-25 13:24 ` Larry Kilgallen
2005-09-25 14:04 ` Pascal Obry
2005-09-25 14:24 ` Martin Krischik
2005-09-25 15:25 ` Georg Bauhaus
2005-09-25 15:32 ` Georg Bauhaus
2005-09-25 16:02 ` Pascal Obry
2005-09-25 16:02 ` Pascal Obry
2005-09-26 7:44 ` Maciej Sobczak
2005-09-26 21:07 ` Florian Weimer
2005-09-27 4:31 ` Simon Wright
2005-09-27 7:18 ` Tapio Kelloniemi
2005-09-27 23:43 ` Florian Weimer
2005-09-28 20:43 ` Simon Wright
2005-09-29 23:24 ` Randy Brukardt
2005-09-26 21:05 ` Florian Weimer
2005-09-25 11:57 ` Marin David Condic
2005-09-25 15:21 ` Björn Persson
2005-09-25 22:25 ` Jeffrey R. Carter
2005-09-26 18:09 ` David Emery
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox