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!news4.google.com!feeder.news-service.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!138.195.8.3.MISMATCH!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: How do I write directly to a memory address? Date: Wed, 9 Feb 2011 20:18:37 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: 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> <4d5031fe$0$6765$9b4e6d93@newsspool3.arcor-online.net> <1f229967-d3cf-42b6-8087-c97ee08652f3@i40g2000yqh.googlegroups.com> <4d5116d1$0$7657$9b4e6d93@newsspool1.arcor-online.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1297304321 25710 69.95.181.76 (10 Feb 2011 02:18:41 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 10 Feb 2011 02:18:41 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 Xref: g2news2.google.com comp.lang.ada:18168 Date: 2011-02-09T20:18:37-06:00 List-Id: "Georg Bauhaus" wrote in message news:4d5116d1$0$7657$9b4e6d93@newsspool1.arcor-online.net... ... > Strict contracts in subprogram profiles. Ha! Software that doesn't have them is garbage. Period. Even in Ada. > void foo2(int jump) > /* make sure jump % 2 == 0! */ > { > ... > } > > Write that in Ada 2005 to demonstrate the glorious power of > your subtype constraints. When was it that compilers will > support aspects reliably? Can't be done. It illustrates my point that even Ada doesn't have enough support for non-garbage software. But Ada 2012 can do it: subtype Odd_Natural is Natural with Dynamic_Predicate => Odd_Natural mod 2 /= 0; procedure Foo2 (Jump : Odd_Natural) is ... A call Foo2(2); will raise Assertion_Error because the predicate fails. There are also static predicates, which of course could be checked at compile-time with static operands. This isn't in that form, however. Randy.