Should we deprecate comma?

Sarath Kodali sarath at dummy.com
Mon Mar 24 06:21:49 PDT 2014


On Sunday, 23 March 2014 at 20:56:45 UTC, Andrei Alexandrescu 
wrote:
> Discuss: https://github.com/D-Programming-Language/dmd/pull/3399
>
> Andrei

The extensive use of binary comma operator that I had seen was in 
ctrace code.  
(http://docs.oracle.com/cd/E24457_01/html/E22003/ctrace.1.html). 
ctrace takes C code and inserts printfs for each statement so 
that the flow and variables' value can be observed during its 
execution.

For example,

while ((c = getchar()) != EOF)

is written as

while ( ((c = getchar()), printf(fmt, c), c) != EOF)

- Sarath


More information about the Digitalmars-d mailing list