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!feeder.news-service.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.134.4.91.MISMATCH!news2.euro.net!multikabel.net!newsfeed20.multikabel.net!feed.xsnews.nl!border-3.ams.xsnews.nl!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Mon, 07 Feb 2011 15:58:44 +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> In-Reply-To: <737a6396-72bd-4a1e-8895-7d50f287960e@d28g2000yqc.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4d5008a5$0$6879$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 07 Feb 2011 15:58:45 CET NNTP-Posting-Host: 203b840c.newsspool2.arcor-online.net X-Trace: DXC=5TT4]\<`Q7GX36K@\WTHGJA9EHlD;3YcB4Fo<]lROoRA8kFJLh>_cHTX3jMJVjJ On 07.02.11 14:56, Ludovic Brenta wrote: > This bad style had > a lot of influence on the programmers of 15 years ago whose code I > must now maintain. Exactly. Style has, by hypothesis, a strong impact on on code quality, since programming patterns and programming idioms are passed on at every stage of becoming outdated. Programmers will copy idioms with little consideration, especially when idioms have become associated with revered authors, first edition. They are not updated. They are also not updated because compilers will not reject old code. > In Ada, this bad style is simply not possible. It sure is possible to write awful and dangerous Ada text, even with the dangers hidden. While this style is possible, Ada culture is less tolerant. (Or, more skeptical of the "practical" programmer.) > In Ada, "in" really means "in". No, "in" is intended to mean "in". There are two reasons that this is not an unbreakable property. The first is demonstrated by Ada.Numerics.Discrete_Random.Random. But Random is the exception rather than the rule, Ada tradition promotes the reverse effect of what C tradition promotes, I think: by Ada's default, by the traditional idiom, "in" stands for "in". (In the case of void safety, the language discussions include comments bemoaning that we'll have to write "not null" instead of marking the reverse case (may be null), thus underlining the tradition.) The second reason that "in" need not mean "in" is less brutal: it is the possibility of write access to a parameter object from within the function if the objects is also a global object. (Global to the function). (Whence Ada getting "in out" parameters for functions is considered an act of honesty, if I understand comment in ARG mail correctly.) Again, this kind of access is considered by style (and is also possible in C). >> For further ammunition for Verdun style language comparisons, >> see function Ada.Numerics.Discrete_Random.Random. > > What does that mean? It means that Ada function Ada.Numerics.Discrete_Random.Random only works because it violates its "contract". The parameter (a generator object) is passed "in", but is modified. Its mutation is one effect of calling function Random. >> I think there are better arguments. > > No. Yes, and you have named them. They seem to have a little less to do with the language definitions, but rather with "encouragement" to write your intentions properly. (In at least one video (lecture? Ada UK?) Robert Dewar has been emphasizing a cultural issue a few times).