Expressing conditionals with boolean logic

Factor handbook » The language » Combinators » Conditional combinators

Factor handbook » The language » Combinators » Conditional combinators

Prev: | case ( obj assoc -- ) |

Certain simple conditional forms can be expressed in a simpler manner using boolean logic.

The following two lines are equivalent:

The following two lines are equivalent:

The following two lines are equivalent, where L is a literal:

The following two lines are equivalent:

[ drop f ] unless
swap and

The following two lines are equivalent:

[ ] [ ] ?if
swap or

The following two lines are equivalent, where L is a literal:

[ L ] unless*
L or

This documentation was generated offline from a
`load-all`

image. If you want, you can also
browse the documentation from within the UI developer tools. See
the Factor website
for more information.

Factor 0.100 x86.64 (2270, heads/master-9a858f779b, Jun 12 2024 16:13:38)