smart-with ( param obj quot -- obj curry )


Vocabulary
combinators.smart

Inputs and outputs
paraman object
objan object
quota quotation with stack effect ( param ..a -- ..b
currya curry


Word description
A version of with that puts the parameter before any inputs the quotation uses.

Definition
USING: generalizations kernel ;

IN: combinators.smart

: smart-with ( param obj quot -- obj curry )
swapd dup inputs [ -nrot ] curry [ dip call ] curry 2curry
; inline