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.99 x86.64 (2192, heads/master-92cfe886c7, Feb 8 2023 09:12:15)