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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,886c71cc8d798d67 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.180.141 with SMTP id bu13mr5083211qab.2.1351096340550; Wed, 24 Oct 2012 09:32:20 -0700 (PDT) Received: by 10.52.91.168 with SMTP id cf8mr3009276vdb.6.1351096340430; Wed, 24 Oct 2012 09:32:20 -0700 (PDT) Path: r17ni57592152qap.0!nntp.google.com!x14no6801621qar.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 24 Oct 2012 09:32:20 -0700 (PDT) In-Reply-To: <277d0e8f-6b00-44e9-8d1f-1d25007fcc72@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=205.232.38.191; posting-account=kLM-CAoAAAD1qD8LldjLWCXYzERl03-C NNTP-Posting-Host: 205.232.38.191 References: <277d0e8f-6b00-44e9-8d1f-1d25007fcc72@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <1dd4109c-1190-4d51-ae57-d171a4d50f41@googlegroups.com> Subject: Re: Anouncement: OpenGL Binding w/ Ada-2012. From: Quentin Ochem Injection-Date: Wed, 24 Oct 2012 16:32:20 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-10-24T09:32:20-07:00 List-Id: > If you do give it a try, feel free to post impressions, ideas, suggestions. One suggestion: there's a number of cases where pre conditions can be replaced by proper subtyping, e.g.: procedure PointSize (size : float) with pre => not Executing AND size > 0.0; Can be replaced by: subtype Positive_Float is Float range 0.0 .. Float'Last; procedure PointSize (size : Positive_Float) with pre => not Executing; It seems good practice to use subtyping whenever possible, in particular if it's a property of a parameter, and let Pre condition for more complex properties related to the subprogram as a whole. Just my 2 cents...