by slaymaker1907 · 9y ago · 0 comments
All I see is "C with different syntax". That could easily be a challenging side project whilst learning compilers / language design.
I've always found changing things up a useful means of practice. I wanted to learn how HTTP servers worked. I wanted to learn more Lisp. I implemented it in Common Lisp. I learned a lot.
{
int x = (side_effect(), initializing_expr());
int y = x + 42;
From C99 onward, this could be: {
side_effect();
int x = initializing_expr();
int y = x + 2;
We use the comma operator in for loops because it has places in its syntax which take one expression. This limitation can arise in other contexts, like some macro MAC(E) where E must be a single expression. If want to to have two sequenced effects in there, we can use MAC((eff1, eff2)).