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!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Type invariants and private extensions? Date: Tue, 12 Sep 2017 21:56:39 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <364ff8e0-c7dd-4980-b19f-5d438edd8353@googlegroups.com> <7df81b3c-1fde-4395-8b9b-1a945820a7f7@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 12 Sep 2017 19:56:39 -0000 (UTC) Injection-Info: reader.eternal-september.org; posting-host="22f2b84e7b7b28cb881445d9d9076c92"; logging-data="26946"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Jd5QsfBrVSOjdhnU7wSdPkabu8hxE8gM=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:h3HqZ9WPWy5ho3s9bgopGaMxTVI= Xref: news.eternal-september.org comp.lang.ada:48085 Date: 2017-09-12T21:56:39+02:00 List-Id: On 09/12/2017 08:54 PM, Victor Porton wrote: > > A SPARQL query may return boolean, graph, bindings, etc. The return type is > determined by the text of the query. > > I want to make derived types of a query which are validated that their > return is of a certain type (e.g. a boolean). This certainly useful in a > language like Ada intended for reliability and maximum runtime check during > debugging. "I want to" is not the same as "there is no way to solve the problem in current Ada". Ada has a feature that provides exactly what you need. It's called a variant record. -- Jeff Carter "Why don't you bore a hole in yourself and let the sap run out?" Horse Feathers 49