chickadee » chicken » base » define-inline

(define-inline (NAME VAR ...) BODY ...)syntax
(define-inline (NAME VAR ... . VAR) BODY ...)syntax
(define-inline NAME EXP)syntax

Defines an inline procedure. Any occurrence of NAME will be replaced by EXP or (lambda (VAR ... [. VAR]) BODY ...). This is similar to a macro, but variable names and scope are handled correctly.

Inline substitutions take place after macro-expansion, and any reference to NAME should appear textually after its definition. Inline procedures are local to the current compilation unit and are not available outside of the source file in which they are defined. Names of inline procedures still exist in the Scheme namespace and can be lexically shadowed. Inline definitions should only appear at the toplevel.

Note that the inline-limit compiler option does not affect inline procedure expansion, and self-referential inline procedures may cause the compiler to enter an infinite loop.

In the third form, EXP must be a lambda expression.

This construct is equivalent to define when evaluated or interpreted.