C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] P2961R1 syntax for Contracts: viable for C?

From: Timur Doumler <cpp_at_[hidden]>
Date: Sun, 8 Oct 2023 19:06:18 +0300
Hi Ville,

> On 8 Oct 2023, at 16:49, Ville Voutilainen <ville.voutilainen_at_[hidden]> wrote:
> There's a rather simple solution to this problem, though: don't use
> the colon, rename 'assert' to something else like 'contract_assert' in
> contract
> annotations, and make contract annotations really be attributes.

Yes, from a technical perspective I think this would work just fine. At least until you get to the post-MVP extensions like labels on contracts, captures on contracts, requires-clauses on contracts – then you'd have to figure out how to fit all of that into "real attributes" grammar as well. If you can figure out how to do that, you're more than welcome to write a proposal and SG21 will be happy to consider it.

Cheers,
Timur

Received on 2023-10-08 16:06:22