Higher-Order Procedures


Sectioning

(left-section binproc left)
Traditional Higher-Order Procedure. Given a two-parameter procedure and a value, creates a new anonymous one-parameter procedure by filling in the first (left) parameter of the procedure. The new procedure, when applied to a value, v, returns (binproc left v).
(right-section binproc right)
Traditional Higher-Order Procedure. Given a two-parameter procedure and a value, creates a new anonymous one-parameter procedure by filling in the second (right) parameter of the procedure. The new procedure, when applied to a value, v, returns (binproc v right).
(l-s binproc left)
Traditional Higher-Order Procedure. A shorthand for left-section.
(r-s binproc right)
Traditional Higher-Order Procedure. A shorthand for right-section.

Boolean Higher-Order Procedures

(^and f1 f2 ... fn)
Traditional Higher-Order Procedure. A higher-order version of and. Creates a new procedure that, when applied to some values, returns (and (f1 values) (f2 values) ... (fn values)).
(^or f1 f2 ... fn)
Traditional Higher-Order Procedure. A higher-order version of or. Creates a new procedure that, when applied to some values, returns (or (f1 values) (f2 values) ... (fn values)).
(^not pred?)
Traditional Higher-Order Procedure. A higher-order version of not. Creates a new procedure, that, when applied to some values, returns the opposite of pred?. That is, (1) if pred? returns a truish value when applied to some parameters, the new procedure returns #f when applied to those same parameters; (2) if pred? returns false when applied to some parameters, the new procedure returns #t when applied to those same parameters.

Miscellaneous Higher-Order Procedures

(compose f g)
Traditional Higher-Order Procedure. Build a one-parameter procedure that applies g to its parameter, and then f to that result. ((compose f g) x) is the same as (f (g x)).
(o f1 f2 ... fn-1 fn)
Traditional Higher-Order Procedure. Build a one-parameter procedure that applies each f, in turn, starting with fn and working backwards. The composition, when applied to a value, x, produces the same result as (f1 (f2 (... (fn-1 (fn x))))).
(constant value)
Traditional Higher-Order Procedure. Create a new function that always returns value, no matter what parameters it is applied to.

Jerod Weinman