|
Archives
D Programming
digitalmars.Ddigitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger D.gnu D C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.learn - expression
what is the purpose of the expression grammar Expression: AssignExpression AssignExpression , Expression ? (emphasis on the comma) May 29 2009
Ellery Newcomer wrote:what is the purpose of the expression grammar Expression: AssignExpression AssignExpression , Expression ? (emphasis on the comma) May 30 2009
Frits van Bommel:To allow two expressions separated by a comma to be another expression. This is only useful if the expression before the last comma has side-effects of course, since its value isn't used. Such an expression returns the result of its right-hand side. For example: (foo(), bar()) is an expression that calls foo(), then calls bar() and evaluates to the return value of bar(). This is mostly used in the increment clause of a for loop, like this: May 30 2009
|