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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2cc84c0fee9046c0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!news-peer1!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: Martin Dowie Newsgroups: comp.lang.ada Subject: Re: Various Language Architecture Questions Date: Sun, 25 Sep 2005 07:24:04 +0000 (UTC) Organization: BT Openworld Message-ID: References: <1127615832.540718.246970@g43g2000cwa.googlegroups.com> <1127624825.425796.61240@g43g2000cwa.googlegroups.com> NNTP-Posting-Host: host81-152-56-192.range81-152.btcentralplus.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com 1127633044 8483 81.152.56.192 (25 Sep 2005 07:24:04 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Sun, 25 Sep 2005 07:24:04 +0000 (UTC) In-Reply-To: <1127624825.425796.61240@g43g2000cwa.googlegroups.com> X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) Xref: g2news1.google.com comp.lang.ada:5126 Date: 2005-09-25T07:24:04+00:00 List-Id: 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