Skip to content
Masataro Asai edited this page Apr 12, 2015 · 7 revisions

Syntax:

namespace optimizer

function symbol-optimizer symbol -> function

function (setf symbol-optimizer) function symbol -> symbol

variable *optimizer*

macro in-optimizer name

macro defoptimizer name args &body body

Arguments and Values:

*optimizer* : a symbol bound to an optimizer function in optimizer namespace.

function : an optimizer function of 1 required argument and the other keyword arguments.

name : a symbol, not evaluated

args : a function-lambda-list.

Description:

function should be of (ftype (function (list &key &allow-other-keys) list)). The required argument is a list of multiclauses. The function should return a list of modified clauses.

The keyword arguments contains additional information in the context. Currently, Trivia adds :types information, which is a list of types that the matching arguments are already known to be of in the current context.

defoptimizer is a convenience macro that registers the given function definition as the optimizer.