From Fedora Project Wiki
(Created page with "= Things that could be done to make C better without really changing very much = - case 1..100: - conditionals statements as expressions: if (control_flow(expr) stmt0;) stm...")
 
Line 1: Line 1:
= Things that could be done to make C better without really changing very much =
= Things that could be done to make C better without really changing very much =


- case 1..100:
- switch (x) { case 1..100: ; }
- conditionals statements as expressions:
- conditionals statements as expressions
   if (control_flow(expr) stmt0;) stmt1;
   if (control_flow(expr) stmt0;) stmt1;
   where the while(expr) stmt evaluates to 0 if stmt0 is never executed, or stmt0 the last time it is
   where the while(expr) stmt evaluates to 0 if stmt0 is never executed, or stmt0 the last time it is

Revision as of 14:36, 30 October 2015

Things that could be done to make C better without really changing very much

- switch (x) { case 1..100: ; } - conditionals statements as expressions

 if (control_flow(expr) stmt0;) stmt1;
 where the while(expr) stmt evaluates to 0 if stmt0 is never executed, or stmt0 the last time it is
 and:
 if (control_flow(expr) stmt0; else stmt1;) stmt2;
 which is essentially the same except stmt2 always happens after stmt1.

- #def ... #endef , so we don't have to use \ on macros

 - this gets us multi-line macros that still basically look like C and don't have to have \ all over the place, and get syntax highlit right
 - and error messages you can read from the compiler, by default.