Date: Thu, 19 Aug 2021 23:25:21 +0300
Hi,
I had a few thoughts for small additions to the language and I wanted to
hear if these ideas had already been suggested in some form or other and
what people thought of them.
1. bit flag enums - have a way to mark an enum as a bit flag, so that the
default assigned values would be 0x01, 0x02, 0x04, 0x08, etc.
2. conditional return - This would really be just syntactic sugar, but
instead of
if (retVal == FAIL)
return retVal;
have something like
return_if (retVal == FAIL) retVal;
it seems cleaner to me.
I had a few thoughts for small additions to the language and I wanted to
hear if these ideas had already been suggested in some form or other and
what people thought of them.
1. bit flag enums - have a way to mark an enum as a bit flag, so that the
default assigned values would be 0x01, 0x02, 0x04, 0x08, etc.
2. conditional return - This would really be just syntactic sugar, but
instead of
if (retVal == FAIL)
return retVal;
have something like
return_if (retVal == FAIL) retVal;
it seems cleaner to me.
Received on 2021-08-19 15:26:01