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,1676be4fafed1dbb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: Wojtek Narczynski Newsgroups: comp.lang.ada Subject: Re: Semantics of Inline vs non-Inline Date: Fri, 15 Oct 2004 12:24:41 +0200 Organization: tp.internet - http://www.tpi.pl/ Message-ID: References: <35f054ea.0410140733.5f250e6f@posting.google.com> NNTP-Posting-Host: avw170.neoplus.adsl.tpnet.pl Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: nemesis.news.tpi.pl 1097836095 13275 83.27.56.170 (15 Oct 2004 10:28:15 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Fri, 15 Oct 2004 10:28:15 +0000 (UTC) User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Xref: g2news1.google.com comp.lang.ada:5250 Date: 2004-10-15T12:24:41+02:00 List-Id: Hello, >> I think that using Unchecked_Conversion, instead of (ab)using 'Address >> rep clause, will fix the problem. > > No abuse. 'Address is legal Ada. A novel or unexpected use does not > mean that it 'abuses' the language. The current use allows the > equivalent of a C/++ 'union'. Other C.L.A. communication shows this > to be both a viable use and (to some) a good one. I cannot agree to that. It is a totally unchecked conversion of anything into anything (GNAT is kind enough to do some checks voluntarily). This is the way to defeat the Ada type system. It is mostly used to overcome the lack of 'out' parameters for functions. And we're just discussing a case where the use of 'Address led to a runtime crash. For C++ like unions you'll have pragma Unchecked_Union in Ada 2005. >> Oh, and why is Push a function? > > Why not? > > Although written in FORTRAN II and somewhat dated, the core design is > valid and provide an extensive set of tools to manipulate general > lists. Part of the design is the use of return values to allow an > application to nest function calls to generate a single useful > result, as in 'Cell := Push(Push(datum));'. This format of algebraic > is not much in use (for quite good reason) but as both legacy and > currency it still deserves a place. Okay, that's nice. Regards, Wojtek