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.50.61.242 with SMTP id t18mr9982037igr.3.1383770966683; Wed, 06 Nov 2013 12:49:26 -0800 (PST) X-Received: by 10.49.76.38 with SMTP id h6mr149023qew.9.1383770966648; Wed, 06 Nov 2013 12:49:26 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!o2no22956512qas.0!news-out.google.com!9ni14413qaf.0!nntp.google.com!i2no13983712qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 6 Nov 2013 12:49:26 -0800 (PST) In-Reply-To: <8a7f97ef-672e-4930-9502-e1202dd158fd@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=93.37.80.0; posting-account=9fwclgkAAAD6oQ5usUYhee1l39geVY99 NNTP-Posting-Host: 93.37.80.0 References: <19b9cc6b-28a4-45e4-939c-7720ae5666b9@googlegroups.com> <8a7f97ef-672e-4930-9502-e1202dd158fd@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <60be5eb1-85e0-43c5-8c81-d191ee805dd3@googlegroups.com> Subject: Re: Question about asynchronous calls From: mockturtle Injection-Date: Wed, 06 Nov 2013 20:49:26 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Received-Bytes: 2125 Xref: news.eternal-september.org comp.lang.ada:17590 Date: 2013-11-06T12:49:26-08:00 List-Id: On Wednesday, November 6, 2013 8:54:02 PM UTC+1, Shark8 wrote: > > > While it doesn't seem like a big thing: subtypes. > > It's nice not to have to check results of some-function from obviously-incorrect-but-technically-possible values like we have to in C/C++/PHP: > > Ex: Some_Array'Length returns Natural, I don't have to check for -1 whenever I use it. Thank you for the suggestion. Actually, I already have something like that in program, with an example taken from some code of mine: a type representing a valid Matlab variable name (I hope the wrap-around does not mess with the code) type Matlab_Name is new String with Dynamic_Predicate => (for all I in Matlab_Name'Range => Is_Alphanumeric (Matlab_Name (I)) or Matlab_Name (I) = '_') and Is_Letter (Matlab_Name (Matlab_Name'First)); I am just beginning to use this, contracts and invariants and it turns out that they are amazing "bug traps."