higher-order macro

higher-order macro

A means of expressing certain higher-order functions in afirst order language. Proposed by Phil Wadler. Higher-ordermacros cannot be recursive at the top level but they maycontain recursive definitions. E.g.

map f l = m lwherem [] = []m (x:xs) = f x : m xs

Expanding a call to this macro is equivalent to specialising acall to map in its first argument.

See partial evaluation.