Skip to content

Commit

Permalink
Update faq.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas authored Oct 16, 2023
1 parent 84c23db commit a270d66
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/src/manual/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,10 @@ x in Set([x])
any(isequal(x), [x])
```

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

0 comments on commit a270d66

Please sign in to comment.