Sujet : Re: Reduction expressions
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.adaDate : 21. Aug 2024, 03:37:22
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <va3gci$3iue9$11@dont-email.me>
References : 1 2 3 4 5
User-Agent : Pan/0.159 (Vovchansk; )
On Tue, 20 Aug 2024 16:41:55 -0700, Keith Thompson wrote:
A subtype with no added constraint is similar to a C typedef, but given
subtype Digit is Integer range 0..9;
Digit is distinct from Integer (though they're both the same type).
“Integer range 0..9” is a subtype of Integer, and is valid for example as
a return type where Integer is expected. The “subtype” declaration doesn’t
actually create the subtype: “Digit” is just a shorthand name for that,
just like a C typedef.