Why are only parts of my strategies executed?
I use theAsked by Guido Wachsmuth on 19 March 2013 at 04:28
;operator to combine two strategies but only the first is executed. The two strategies are all used to generate files from one source file.
There are two reasons why this can happen:
- The first strategy fails late. You can observe side effects of this strategy (such as a generated file) because side effects are not rolled back. However, the failing of the strategy prevents the execution of the second strategy.
- The second strategy fails early before anything is generated.
You can add debug messages to your code, to figure out where a strategy fails:Answered by Guido Wachsmuth on 19 March 2013 at 04:32
debug(!"before s1 "); s1; debug(!"after s1 "); s2; debug(!"after s2 ").