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-Language: ENGLISH,ASCII-7-bit From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Gem 39 - compiler specific? Date: Thu, 3 Sep 2009 17:06:48 -0500 Organization: Jacob Sparre Andersen Message-ID: References: <9e0bbbcd-260f-48ed-8043-d6280c633e85@h3g2000yqa.googlegroups.com> <19268dbw82hf4.aii8as09aapk.dlg@40tude.net> <4bff103b-1797-4e2b-9dcf-7466b667c59b@d9g2000prh.googlegroups.com> <1s8kuin5t96vr$.1taw9mluqlplz$.dlg@40tude.net> <1bf4b63a-1e2d-41f1-97c6-8324d4b829ff@z3g2000prd.googlegroups.com> <6o3frhrv0n0p$.8wj0gszs5h07$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1252015686 27647 69.95.181.76 (3 Sep 2009 22:08:06 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 3 Sep 2009 22:08:06 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!feed.ac-versailles.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail Xref: g2news2.google.com comp.lang.ada:8139 Date: 2009-09-03T17:06:48-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:6o3frhrv0n0p$.8wj0gszs5h07$.dlg@40tude.net... ... > Why do we have Access_To_Address_Conversions? Why not to require > Unchecked_Conversion to do all the checks Access_To_Address_Conversions > does in the corresponding cases? I mean, there is no obvious reason why > the > implementation of Access_To_Address_Conversions should be safer than one > of > Unchecked_Conversion. The information the compiler has at the > instantiation > point is just same. Because the intent is that Unchecked_Conversion never actually does anything other than change the type. In particular, it should not change the representation. But it is not uncommon for System.Address and an access type to have a different representation. For instance, the Janus/Ada 16-bit MS-DOS compilers uses a 32-bit segmented value for System.Address, but access types were just 16-bit pointers into the heap. (Our early 32-bit 386 compilers used 48-bit addresses; that was quite useful on early DOS extenders, for instance.) The intent leads to the rule that Unchecked_Conversion is only well-defined when the sizes of the two types are the same. As noted, that doesn't need to be the case for System.Address. You seem to want to muddle up the semantics to include some real conversions. That would be a problem inside of generics (what if the actual parameter is System.Address?? Do you get the special semantics or not? Either answer is uncomfortable and requiring the special semantics would have bad consequences on code generation and legality rules), and in any case is not very consistent. Randy.