From: Lawrence D'Oliveiro <ldo@nz.invalid>
Subject: Re: Reduction expressions
Date: Wed, 21 Aug 2024 01:37:22 -0000 (UTC) [thread overview]
Message-ID: <va3gci$3iue9$11@dont-email.me> (raw)
In-Reply-To: 874j7edanw.fsf@nosuchdomain.example.com
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.
next prev parent reply other threads:[~2024-08-21 1:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-13 12:36 Reduction expressions Simon Wright
2024-08-20 3:59 ` Randy Brukardt
2024-08-20 21:23 ` Simon Wright
2024-08-20 23:30 ` Lawrence D'Oliveiro
2024-08-20 23:41 ` Keith Thompson
2024-08-21 1:37 ` Lawrence D'Oliveiro [this message]
2024-08-21 7:47 ` Simon Wright
2024-08-24 4:27 ` 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