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,c9d5fc258548b22a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!weretis.net!feeder4.news.weretis.net!news1.tnib.de!feed.news.tnib.de!news.tnib.de!newsfeed.freenet.ag!news.netcologne.de!ramfeed1.netcologne.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Mon, 07 Feb 2011 18:55:09 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How do I write directly to a memory address? References: <67063a5b-f588-45ea-bf22-ca4ba0196ee6@l11g2000yqb.googlegroups.com> <31c357bd-c8dc-4583-a454-86d9c579e5f4@m13g2000yqb.googlegroups.com> <05a3673e-fb97-449c-94ed-1139eb085c32@x1g2000yqb.googlegroups.com> <8r86vgFc3uU1@mid.individual.net> <19fh1chm74f9.11cws0j5bckze.dlg@40tude.net> <4d4ff70e$0$6886$9b4e6d93@newsspool2.arcor-online.net> <737a6396-72bd-4a1e-8895-7d50f287960e@d28g2000yqc.googlegroups.com> <4d5008a5$0$6879$9b4e6d93@newsspool2.arcor-online.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4d5031fe$0$6765$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 07 Feb 2011 18:55:10 CET NNTP-Posting-Host: 1d2d17cb.newsspool3.arcor-online.net X-Trace: DXC=ieJYB@OCK5UHigV@eW57PQMcF=Q^Z^V3X4Fo<]lROoRQ8kFZLh>_cHTX3j]<:ZMX6gD_n\ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:17912 Date: 2011-02-07T18:55:10+01:00 List-Id: On 07.02.11 17:54, Ludovic Brenta wrote: > Georg Bauhaus wrote: >> Exactly. Style has, by hypothesis, a strong impact on on code >> quality [...] > > I would rephrase that as: style has, *in my experience*, a strong > impact on code quality. That's something from which to start an investigation. > You can always program dangerously in Ada but you have to be explicit > about it. Yes. > The generator is not modified; its associated (pointed-to) state is. The state is "its" state; the LRM does not seem to mention a pointer. GNAT uses a limited record with no pointers in it, but does refer to components through non-standard 'Unrestricted_Access inside the function. GNAT: " -- The design of this spec is very awkward, as a result of Ada 95 not -- permitting in-out parameters for function formals (most naturally -- Generator values would be passed this way). " I think it is fair to say that (a) Random modifies the generator's state and that (b) the specification does not reflect that Random acts as this state changing subprogram. > Well, I came to wonder what intentions are conveyed by "void foo (int > arg)" and why modifying arg inside foo could be intentional. Since I > came up with no convincing reason (the only reasons being variants of > premature optimization), I concluded that the possibility of "void foo > (int arg)" as opposed to "void foo (const int arg)" was a flaw in the > C language, that cost me a lot of effort. Ease of implementation when pushing parameters? void foo(int countdown) { while (--countdown) { fputc('.', stdout); } fputc('\n', stdout); }