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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d0475d4d02ffd8d9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.hanau.net!noris.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: To collection (GNAT bug) Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1fo8mdcya4lc1.1xzuim6fz5a6a.dlg@40tude.net> <13weuafrdg7cx$.zkechwsuxyfw.dlg@40tude.net> <87fgklu009fm$.1jy0dch55kk6a.dlg@40tude.net> <5ByUg.89026$aJ.31485@attbi_s21> <1ulni4ytiwx9b$.h3yhtyxju4op.dlg@40tude.net> <1159954035.16821.10.camel@localhost> Date: Wed, 4 Oct 2006 14:10:57 +0200 Message-ID: <1hgjta1aszyil.11y4nqmer9obh.dlg@40tude.net> NNTP-Posting-Date: 04 Oct 2006 14:10:57 CEST NNTP-Posting-Host: 7c59aa43.newsspool1.arcor-online.net X-Trace: DXC=;R8?FDZcC7Hgj[ZPFj7ehOic==]BZ:afN4Fo<]lROoRA^YC2XCjHcbINi[=e2iN@@GDNcfSJ;bb[EFCTGGVUmh?DN\HXHJ4e80NR;XOk\B4oEN X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:6860 Date: 2006-10-04T14:10:57+02:00 List-Id: On Wed, 04 Oct 2006 11:27:15 +0200, Georg Bauhaus wrote: > If you would like to have user level internal data structure > representation interfaces for arrays, pointers, etc., No, I don't like to care about them. This is exactly why the language/compiler provided conversions must be reasonable, or else illegal. Ada is not C. > how do you envision a suitably modified Ada compiler to guarantee > separate compilation, optimization, and LRM-correct > behavior in the presence of user-defined internal representations? You should ask this question yourself. In particular, consider the code I sent once: package Legal is new Address_To_Access_Conversions (String); function To_Addr (X : Ptr) return Address is begin return Legal.To_Address (X.all'Unchecked_Access); end To_Addr; -- This is safe function To_Ptr (X : Address) return Ptr is function Cast is new Ada.Unchecked_Conversion (Legal.Object_Pointer, Ptr); begin return Cast (Legal.To_Pointer (X)); end To_Ptr; What is user-defined in To_Ptr (To_Addr (X))? ---------------------- Clearly a lack of safe general to pool specific conversion of access types is a language design fault. So? Should the compiler vendors make it even worse, by making Unchecked_Conversion return rubbish when the programmer resort to it? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de