Comment

Comment by WalterBright

Here's ImportC in action:

    _Static_assert(square(2) == 4, "failed");

    int square(int x) { return x * 2; }
1. there is no need for constexpr keyword. Anywhere a constant-expression in the C grammar appears, compile time function execution is involved.

2. `square` is forward referenced, but works fine.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton