Skip to content

Commit a270d66

Browse files
Update faq.md
1 parent 84c23db commit a270d66

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/src/manual/faq.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,10 @@ x in Set([x])
8181
any(isequal(x), [x])
8282
```
8383

84+
If `==` is used instead, you will receive `TypeError: non-boolean (Num) used in boolean context`. What this error
85+
is telling you is that the symbolic `x == y` expression is being used where a `Bool` is required, such as
86+
`if x == y`, and since the symbolic expression is held lazily this will error because the appropriate branch cannot
87+
be selected (since `x == y` is unknown for arbitrary symbolic values!). This is why the check `isequal(x,y)` is
88+
required, since this is a non-lazy check of whether the symbol `x` is always equal to the symbol `y`, rather than
89+
an expression of whether `x` and `y` currently have the same value.
90+

0 commit comments

Comments
 (0)