C++ Logo

liaison

Advanced search

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

From: Martin Uecker <ma.uecker_at_[hidden]>
Date: Thu, 05 Oct 2023 20:15:17 +0200
Am Donnerstag, dem 05.10.2023 um 12:48 -0400 schrieb JeanHeyd Meneide via Liaison:
> ---- (With my chair hat OFF) ----
>
> I greatly prefer the syntax of P2961R1. It is superior in every way and does not imply ignorability, no r does it contain the syntax-level ignorability that Aaron pointed out is still in C
> for C23. We have a myriad of ways to fudge the keyword spelling if necessary for C and C++ interop, such as _Pre/__pre__, _Post/__post__, and other syntax tricks we can pull.
>
> However, I don't really have an appetite to actually put Contracts into C myself; I'd let someone else take up that mantle if the C++ experiment proves to be successful.
>
> ---- (With my chair hat ON) ----
>
> If you'd like to get SG22's opinion Officially™, you are more than welcome to say this is important enough to invite a review by SG22. If you picked the [[ ]] attribute syntax it would be
> more important for SG22 to review it and give feedback (And at that point I would *insist* upon a review and feedback), but if not and the syntax is in a novel location I don't see how we'd
> need explicit cooperation. (E.g., when C++11 got static_assert(…), we just handled the syntax difference by having _Static_assert(...) in C and piling an extra keyword in <assert.h>.) Same
> process that Aaron mentioned before: ugly keyword first, normal keyword later. Nothing either Committee can't handle.

But then later on, some people will insist that we standardize it
exactly as in C++ even when we find out that for some reason
the syntax is a poor fit for C.

But one can not have it both ways: Either we agree on a common
syntax now or we should feel free to diverge later if this is
better for C for some reason.

Martin


>
> Sincerely,
> JeanHeyd
> _______________________________________________
> Liaison mailing list
> Liaison_at_[hidden]
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/liaison
> Link to this post: http://lists.isocpp.org/liaison/2023/10/1228.php

Received on 2023-10-05 18:15:20