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 X-Received: by 10.68.222.194 with SMTP id qo2mr9709978pbc.6.1406338414177; Fri, 25 Jul 2014 18:33:34 -0700 (PDT) X-Received: by 10.182.225.162 with SMTP id rl2mr157984obc.13.1406338413765; Fri, 25 Jul 2014 18:33:33 -0700 (PDT) Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!h18no4513092igc.0!news-out.google.com!px9ni0igc.0!nntp.google.com!h18no7719147igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 25 Jul 2014 18:33:33 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.57.209.48; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 173.57.209.48 References: <1xeciz1z2smla$.lxa15ypfbre9$.dlg@40tude.net> <3e94fe4f-c9f4-41dd-95e7-a0e329a2ef48@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <1921383c-3329-439e-adb5-321eef18defc@googlegroups.com> Subject: Re: Effective use of derived types From: "Dan'l Miller" Injection-Date: Sat, 26 Jul 2014 01:33:33 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: number.nntp.dca.giganews.com comp.lang.ada:187882 Date: 2014-07-25T18:33:33-07:00 List-Id: On Friday, July 25, 2014 2:33:15 PM UTC-5, Dmitry A. Kazakov wrote: > On Fri, 25 Jul 2014 11:40:58 -0700 (PDT), Dan'l Miller wrote: > > I say of course URI should be a subtype of string in Ada2012 so that it > > can Dynamic_Predicate post-conditions that enforce the regular expressi= on > > that URIs must obey. >=20 > I doubt that were realistic. In any case the amount of work required to > design such a predicate would be far bigger than in the case of a proper > type. Usefulness would be near to zero. The Dynamic_Predicate could raise an exception for a URI string (e.g., a UR= L_string) that does not conform to the regular expression that all supporte= d URIs (e.g., URLs) are required to obey. Or are raising exceptions in Dmi= try's same Bucket-of-Uselessness* as finite-state machines? * some of which, other programmers find to be actually useful > It is like designing a predicate > that yields true of the string contains a valid Ada program... mere hyperbole that does not answer Victor's question