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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.13.207.1 with SMTP id r1mr51875152ywd.46.1435125471207; Tue, 23 Jun 2015 22:57:51 -0700 (PDT) X-Received: by 10.50.18.6 with SMTP id s6mr12971igd.16.1435125471176; Tue, 23 Jun 2015 22:57:51 -0700 (PDT) Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!z60no2986402qgd.1!news-out.google.com!a16ni3110ign.0!nntp.google.com!h15no7756043igd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 23 Jun 2015 22:57:50 -0700 (PDT) In-Reply-To: <01ac6d30-fa93-4868-aa31-3dbec93e9a21@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=24.6.21.101; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6 NNTP-Posting-Host: 24.6.21.101 References: <9894cde7-2cf8-4060-be65-857812ad7b09@googlegroups.com> <17436268-aceb-461f-bdcf-eee8436cd0e6@googlegroups.com> <86y4jaqzdx.fsf@stephe-leake.org> <01ac6d30-fa93-4868-aa31-3dbec93e9a21@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: What do you think about this? From: Anh Vo Injection-Date: Wed, 24 Jun 2015 05:57:51 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: number.nntp.giganews.com comp.lang.ada:193757 Date: 2015-06-23T22:57:50-07:00 List-Id: On Tuesday, June 23, 2015 at 3:17:52 PM UTC-7, Shark8 wrote: > On Tuesday, June 23, 2015 at 3:03:21 PM UTC-6, Laurent wrote: > > You mean like this? Sry no idea on how to use pre/post conditions. > > > > function "+" (Right : String) return V_String.Bounded_String > > is (V_String.To_Bounded_String (Right)) > > with pre => Right <= V_String_Length; > > You want Right'Length, not Right. You are right. I meant string length, Right'Length, as stated. In addition, "pragma Assertion_Policy (Check);" should be added at the top of the package. This pragma has the same effect as switch -gnata under GNAT. Of course, all compiler must comply with pragma Assertion_Policy.