dual-op ( word -- quot )


Vocabulary
math.dual

Inputs
worda word


Outputs
None

Word description
Similar to execute, but promotes word to operate on duals.

Notes
Uses the derivative word-prop, which holds a list of quotations giving the partial derivatives of the word with respect to each of its arguments. This can be set using DERIVATIVE:. Once a derivative has been defined for a word, dual-op makes it easy to extend the definition to dual numbers.

Examples
USING: math math.dual math.derivatives.syntax math.functions ; DERIVATIVE: sin [ cos * ] M: dual sin \sin dual-op ;

USING: math math.dual math.derivatives.syntax ; DERIVATIVE: * [ drop ] [ nip ] : d* ( x y -- x*y ) * dual-op ;


See also
define-dual, DERIVATIVE:

Definition