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=unavailable autolearn_force=no version=3.4.4 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!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!news.uni-weimar.de!medsec1.medien.uni-weimar.de!lucks From: Stefan.Lucks@uni-weimar.de Newsgroups: comp.lang.ada Subject: Re: Question about asynchronous calls Date: Thu, 7 Nov 2013 08:46:54 +0100 Organization: Bauhaus-Universitaet Weimar Message-ID: References: <19b9cc6b-28a4-45e4-939c-7720ae5666b9@googlegroups.com> <8a7f97ef-672e-4930-9502-e1202dd158fd@googlegroups.com> <60be5eb1-85e0-43c5-8c81-d191ee805dd3@googlegroups.com> NNTP-Posting-Host: medsec1.medien.uni-weimar.de Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1340362459-1383810415=:26025" X-Trace: pinkpiglet.scc.uni-weimar.de 1383810518 14806 141.54.178.228 (7 Nov 2013 07:48:38 GMT) X-Complaints-To: news@pinkpiglet.scc.uni-weimar.de NNTP-Posting-Date: Thu, 7 Nov 2013 07:48:38 +0000 (UTC) X-X-Sender: lucks@debian In-Reply-To: <60be5eb1-85e0-43c5-8c81-d191ee805dd3@googlegroups.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) Xref: news.eternal-september.org comp.lang.ada:17594 Date: 2013-11-07T08:46:54+01:00 List-Id: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1340362459-1383810415=:26025 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Wed, 6 Nov 2013, mockturtle wrote: > type Matlab_Name is new > String > with Dynamic_Predicate =3D> > (for all I in Matlab_Name'Range =3D> > Is_Alphanumeric (Matlab_Name (I)) or Matlab_Name (I) =3D '_') > and > Is_Letter (Matlab_Name (Matlab_Name'First)); I suggest to write the following. with Dynamic_Predicate =3D> ( Natlab_Name'Length > 0 and then Is_Letter (Matlab_Name (Matlab_Name'First) and then for all I in Matlab_Name'First+1 .. Matlab'Last =3D> Is_Alphanumeric (Matlab_Name (I)) or Matlab_Name (I) =3D '_') ); (Warning: not syntax checked!) The "Natlab_Name'Length > 0 and then" part is important -- your code would= =20 raise Constraint_Error if the Matlab_Name is the empty string. The other modifications are a matter of taste. For me, first checking the first character, and then checking the other=20 characters is more intuitive than doing it the other way. Also, I rather=20 avoid the redundant check for the first letter being alphanumeric or '_', since the first character is checked for being a letter, anyway. And I wouldn't bother to replace the second "and then" by "and", as it has= =20 been in your code. However, mixing "and then" and "and" requires=20 additional brackets, which I would prefer to avoid. ------ I love the taste of Cryptanalysis in the morning! ------ --Stefan.Lucks (at) uni-weimar.de, Bauhaus-Universit=E4t Weimar, Germany-- --8323329-1340362459-1383810415=:26025--