From: "Dan'l Miller" <optikos@verizon.net>
Subject: Re: Effective use of derived types
Date: Fri, 25 Jul 2014 18:33:33 -0700 (PDT)
Date: 2014-07-25T18:33:33-07:00 [thread overview]
Message-ID: <1921383c-3329-439e-adb5-321eef18defc@googlegroups.com> (raw)
In-Reply-To: <fb0lrjwhs95g$.7l08fyzgm8gz$.dlg@40tude.net>
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 expression
> > that URIs must obey.
>
> 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 URL_string) that does not conform to the regular expression that all supported URIs (e.g., URLs) are required to obey. Or are raising exceptions in Dmitry'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
next prev parent reply other threads:[~2014-07-26 1:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-25 16:40 Effective use of derived types Victor Porton
2014-07-25 17:38 ` Dmitry A. Kazakov
2014-07-25 18:00 ` Victor Porton
2014-07-25 18:40 ` Dan'l Miller
2014-07-25 19:33 ` Dmitry A. Kazakov
2014-07-26 1:33 ` Dan'l Miller [this message]
2014-07-26 3:34 ` Shark8
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox