From: Victor Porton <porton@narod.ru>
Subject: Re: Type invariants and private extensions?
Date: Tue, 12 Sep 2017 23:08:56 +0300
Date: 2017-09-12T23:08:56+03:00 [thread overview]
Message-ID: <op9esv$1foj$1@gioia.aioe.org> (raw)
In-Reply-To: op9e5n$qa2$1@dont-email.me
Jeffrey R. Carter wrote:
> 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.
It is a tagged type. AFAIK, a type cannot be both a variant record and
tagged.
Moreover, the object in consideration is a wrapper over a certain C API. It
surely cannot be described in variant record terms.
Moreover, bindings may contain more than one row of values which can be
enumerated like an iterator. I am not sure if this can be expressed in terms
of a variant record.
The proposed feature increases reliability of programming. It is undoubtful
that adding more type invariants increases reliability.
--
Victor Porton - http://portonvictor.org
next prev parent reply other threads:[~2017-09-12 20:08 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-11 19:51 Type invariants and private extensions? Victor Porton
2017-09-11 20:00 ` Egil H H
2017-09-11 20:48 ` Victor Porton
2017-09-11 21:19 ` Egil H H
2017-09-11 21:27 ` Victor Porton
2017-09-11 21:49 ` Egil H H
2017-09-11 22:00 ` Victor Porton
2017-09-11 22:06 ` Egil H H
2017-09-12 7:30 ` Dmitry A. Kazakov
2017-09-11 22:00 ` Jere
2017-09-11 22:02 ` Victor Porton
2017-09-12 18:26 ` Jeffrey R. Carter
2017-09-12 18:54 ` Victor Porton
2017-09-12 19:56 ` Jeffrey R. Carter
2017-09-12 20:08 ` Victor Porton [this message]
2017-09-12 22:34 ` Shark8
2017-09-12 22:59 ` Victor Porton
2017-09-13 4:21 ` Jere
2017-09-13 4:28 ` Jere
2017-09-13 4:34 ` Jere
2017-09-14 13:52 ` Victor Porton
2017-09-15 0:48 ` Jere
2017-09-16 14:22 ` Victor Porton
2017-09-14 7:28 ` Shark8
2017-09-14 13:56 ` Victor Porton
2017-09-14 13:58 ` Victor Porton
2017-09-11 22:48 ` Shark8
2017-10-02 23:16 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox