digitalmars.D - Short-circuit evaluation in D
- Shriramana Sharma (13/13) Nov 21 2015 Hello. From http://dlang.org/expression.html#OrOrExpression and the
- deadalnix (4/17) Nov 23 2015 && and || short circuit.
Hello. From http://dlang.org/expression.html#OrOrExpression and the subsequent AndAndExpression section it is clear to me that D does indeed employ short-circuit evaluation true to being part of the C family. But I am disappointed to note that D is not mentioned at https://en.wikipedia.org/wiki/Short-circuit_evaluation. I would edit it myself but the table also mentions eager operators and I'm not sure whether D has any such operators i.e. whether & and | are supposed to be eager in D as they are said to be (as per the table) in C++. So I request someone more knowledgeable about D than me to do the edit and respond here too. Thanks. --
Nov 21 2015
On Saturday, 21 November 2015 at 13:48:06 UTC, Shriramana Sharma wrote:Hello. From http://dlang.org/expression.html#OrOrExpression and the subsequent AndAndExpression section it is clear to me that D does indeed employ short-circuit evaluation true to being part of the C family. But I am disappointed to note that D is not mentioned at https://en.wikipedia.org/wiki/Short-circuit_evaluation. I would edit it myself but the table also mentions eager operators and I'm not sure whether D has any such operators i.e. whether & and | are supposed to be eager in D as they are said to be (as per the table) in C++. So I request someone more knowledgeable about D than me to do the edit and respond here too. Thanks.&& and || short circuit. &, | and ^ do not short circuit.
Nov 23 2015