Breaking ";" rule with lambda functions

pascal111 judas.the.messiah.111 at gmail.com
Mon Aug 1 14:15:31 UTC 2022


We all know the strange syntax of lambda function within filter 
algorithm like "auto r = chain(a, b).filter!(a => a > 0);". My 
note is, don't we break D rules by leaving ";" after lambda 
function syntax?!

Many of D rules are taken from C, we know that, so a general 
basic rule is to put ";" after each statement, so the previous 
statement of filter should be "auto r = chain(a, b).filter!(a => 
a > 0;);"? Why D leaves ";" in this case?


More information about the Digitalmars-d-learn mailing list