From mboxrd@z Thu Jan 1 00:00:00 1970 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.ada Subject: Re: Reduction expressions Date: Tue, 20 Aug 2024 16:41:55 -0700 Organization: None to speak of Message-ID: <874j7edanw.fsf@nosuchdomain.example.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 21 Aug 2024 01:41:56 +0200 (CEST) Injection-Info: dont-email.me; posting-host="7a2cb821a5a9c1554a17483648fb73a0"; logging-data="3749143"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PrOXuPvJVMe8oHIHnx11E" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:UWyrzzvUzLt9YmISQhAVgK2pm38= sha1:OqNt0oNpypYiKzJSUouBTWyiq88= Xref: news.eternal-september.org comp.lang.ada:66309 List-Id: Lawrence D'Oliveiro writes: [...] > I thought the difference was obvious. “subtype” is the C equivalent of > “typedef”, just giving a new name to an existing type. So > > subtype A is B; > > (where A and B are simple identifiers) is valid, whereas > > type A is B; > > is not: a “type” declaration always creates a new type: you have to write > at least > > type A is new B; > > and now you have two types with different names that are structurally the > same, but not compatible. 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). C doesn't have anything directly corresponding to Ada subtypes. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */