with ( param obj quot -- obj curried ) (original) (raw)
Vocabulary
kernel
Inputs
Outputs
Word description
Similar to how curry binds the element below its quotation as its first argument, with binds the second element below quot as the second argument of quot.
In other words, partial application on the left. The following two lines are equivalent:
swap [ swap A ] curry B
[ A ] with B
Notes
This operation is efficient and does not copy the quotation.
Examples
USING: kernel math prettyprint sequences ; 1 { 1 2 3 } [ / ] with map .
{ 1 1/2 1/3 }
USING: kernel math prettyprint sequences ; 1000 100 5 [ sq + + ] 2with map .
{ 1100 1101 1104 1109 1116 }
Definition