Daniel Barrett skrev:
So Rolf, are you saying that the #if statement is broken, or that my #if statement should be changed somehow?
{{#if: {{#some-condition:}} | {{#some-big-computation:}} }}
(Incidentally, my #if statement contains only one boolean expression. {{#some-big-computation:}} is the "THEN" block.)
DanB
-----Original Message----- It's absolutely crucial to short circuit boolen logic at first false result - in cases logically equivalent to AND operations.
Hm. As a matter of fact, it's a difference between should and is. The #if statement SHOULD be regarded as broken, BUT, ParserFunctions seems to have been struggling with this problem for a long time, and for this reason it's not a technical "bug".
However, ParserFunctions really should be fixed to produce short circuit behaviour. Such a change will not change the logical end result in any way, it will only optimize existing code. I think this (potential for optimization) has been discussed earlier but seemingly none has fixed it as yet.
Since I have built a ParserFunction evaluator in Delphi Pascal in order to mimix MWs ditto I know that the optimization potential is very big. The parser now expands so many templates not used in the end result because of it's "complete boolen evauation" behaviour.
So again: The #if statement is not really "broken" (since it behaves as currently designed), BUT your #if statement really SHOULD be changed. =)
Regards,
// Rolf Lampa