Next: , Previous: Defmacro, Up: Scheme Syntax Extension Packages


3.2 R4RS Macros

(require 'macro) is the appropriate call if you want R4RS high-level macros but don't care about the low level implementation. If an SLIB R4RS macro implementation is already loaded it will be used. Otherwise, one of the R4RS macros implemetations is loaded.

The SLIB R4RS macro implementations support the following uniform interface:

— Function: macro:expand sexpression

Takes an R4RS expression, macro-expands it, and returns the result of the macro expansion.

— Function: macro:eval sexpression

Takes an R4RS expression, macro-expands it, evals the result of the macro expansion, and returns the result of the evaluation.

— Procedure: macro:load filename

filename should be a string. If filename names an existing file, the macro:load procedure reads Scheme source code expressions and definitions from the file and evaluates them sequentially. These source code expressions and definitions may contain macro definitions. The macro:load procedure does not affect the values returned by current-input-port, current-error-port, and current-output-port.