comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Subtypes and type invariants in Ada2012
Date: Mon, 21 Aug 2017 18:10:13 +0200
Date: 2017-08-21T18:10:13+02:00	[thread overview]
Message-ID: <onf0d5$rd9$1@dont-email.me> (raw)
In-Reply-To: <oneuqr$5l9$1@gioia.aioe.org>

Le 21/08/2017 à 17:38, Victor Porton a écrit :
> I thought that type invariants are designed for subtypes. I mistook!
> [...] 
> So, my question: Is it possible to restrict a subtype with something like a 
> type invariant?
> 
> I want a subtype restricted by an arbitrary condition. Is it possible?
> 

This is rather a subtype predicate.

Type invariants are here to publicize properties of a private type,
otherwise the user knows nothing about it (since it is private!)
-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr


  reply	other threads:[~2017-08-21 16:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 15:38 Subtypes and type invariants in Ada2012 Victor Porton
2017-08-21 16:10 ` J-P. Rosen [this message]
2017-08-21 16:18 ` Dmitry A. Kazakov
2017-08-21 16:29   ` Victor Porton
2017-08-21 16:52     ` Dmitry A. Kazakov
2017-08-21 17:41       ` Victor Porton
2017-08-21 19:55         ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox