bi ( x p q -- )

Factor handbook » The language » Combinators » Dataflow combinators » Cleave combinators

Factor handbook » The language » Combinators » Dataflow combinators » Cleave combinators

Next: | 2bi ( x y p q -- ) |

Vocabulary

kernel

Inputs

Outputs

None

Word description

Applies p to x, then applies q to x.

Examples

If [ p ] and [ q ] have stack effect ( x -- ), then the following two lines are equivalent:

If [ p ] and [ q ] have stack effect ( x -- y ), then the following two lines are equivalent:

In general, the following two lines are equivalent:

See also

tri, cleave

Definition

kernel

Inputs

x | an object |

p | a quotation with stack effect ( ..a x -- ..b ) |

q | a quotation with stack effect ( ..c x -- ..d ) |

Outputs

None

Word description

Applies p to x, then applies q to x.

Examples

If [ p ] and [ q ] have stack effect ( x -- ), then the following two lines are equivalent:

[ p ] [ q ] bi
dup p q

If [ p ] and [ q ] have stack effect ( x -- y ), then the following two lines are equivalent:

[ p ] [ q ] bi
dup p swap q

In general, the following two lines are equivalent:

[ p ] [ q ] bi
[ p ] keep q

See also

tri, cleave

Definition

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.101 x86.64 (2284, heads/master-4a32b2801d, Nov 5 2024 16:06:40)