Lambdas, Nested Functions, and Blocks (2021)
thephd.dev
thephd.dev
I think the C standards committee needs to figure out memory safety before adding any new features that are likely to interact with it.
void
mkclosure(int x)
{
int x;
void fn(void){ return x + 1; }
return fnheapify(fn);
}
void
useclosure(void)
{
void (^fn)(void) = mkclosure(42);
fn();
fnfree(fn);
}Simmer down, now.