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,c9d5fc258548b22a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: How do I write directly to a memory address? 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: <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> Date: Mon, 7 Feb 2011 16:21:37 +0100 Message-ID: NNTP-Posting-Date: 07 Feb 2011 16:21:38 CET NNTP-Posting-Host: 616eed9e.newsspool4.arcor-online.net X-Trace: DXC=K1g0F7AN7AWV0Pe9PRnbJ\4IUK On Mon, 07 Feb 2011 15:58:44 +0100, Georg Bauhaus wrote: > 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. This is a poor example, because random number is indeed immutable and has no intrinsic state. A pseudo-random generator has state, but the thing it models is stateless. In this sense there is no difference between integer 123 and the random number uniformly distributed on [0,1]. In both cases the corresponding computational object might have state or not. E.g. literal can be stored in the volatile memory. Whether such implementation detail need to be exposed (to have Reset, for example), depends on many factors. See also Ada.Calendar.Clock. > 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. Wrong. You might have an implementation of Random backed by the hardware in which case Random would have no internal state whatsoever. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de