|
|
|
|
|
by vidarh
4229 days ago
|
|
You're thinking imperatively. It is not "do this" but "generate the set of possible solutions". The "soft cut" part I'm presuming is similar to Prolog, where a "cut" indicates that once you've gotten past it, you can't backtrack (roughly - my knowledge of Prolog is rather limited) to try other arms - so "choose" is forced down one path by the guard, and then not allowed to also evaluate the other arm, while "if" can generate both alternatives. |
|
The problem is there even without else.
Should it be or Because IMHO it should be the second one (it's also basicaly the logical definition of implication, which IMHO should be consistent with "if").The first interpretation of if without else just give you another way of writing:
so why "if" at all?And if we take the second interpretation of if without else, then when there's else - it should also get the !if_condition implicitly.