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 Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool2.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="iso-8859-1" Content-Transfer-Encoding: 8bit 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> <5d9bd120-4953-4fb1-a890-27267245e954@8g2000prt.googlegroups.com> Date: Mon, 7 Feb 2011 09:38:53 +0100 Message-ID: NNTP-Posting-Date: 07 Feb 2011 09:38:53 CET NNTP-Posting-Host: 02baef51.newsspool3.arcor-online.net X-Trace: DXC=dWSokQo4;oO78PK[oJ2ng@McF=Q^Z^V3H4Fo<]lROoRA8kF On Sun, 6 Feb 2011 13:27:05 -0800 (PST), Maciej Sobczak wrote: > On Feb 6, 9:01�pm, "Dmitry A. Kazakov" > wrote: > >> Immutable scalar arguments still ire mutable within C and C++ subprograms. > > Scalar arguments are passed by copy, so whether they are immutable or > mutable within the function is independent on their origin (and the > original is not affected by this in any way). > Unless, of course, you have meant something else. Exactly this. Passing mode (by copy vs. by reference) has nothing to do with the mutability contract. Unchanged origin is no argument, because the contract is broken [*]. Compare it to FORTRAN-IV. You can pass INTEGER*4 where REAL*4 is expected. The original view (INTEGER*4) is not affected by the view within the subprogram (REAL*4). Is it OK? No, lessons learned, we know this is not OK. --------------------- * const T is not substitutable for T [almost everywhere]. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de