You are looking at historical revision 9631 of this page. It may differ significantly from its current revision.

simple-macros

Description

André
van Tonders macro and module system.

Note: This extension is currently unsupported. A new version has been released and the maintenance status is unclear.

Author

André
van Tonder

Requirements

None

Download

simple-macros.egg

Documentation

This is a port of the ``simple-macros'' macro and module system by André van Tonder.

For detailed specifications consult the official SRFI documents:

CHICKEN specific notes

At least CHICKEN version 2.110 is required

"Curried" define is allowed, as are definitions of the form (define VARIABLE). Note that DSSSL extended lambda lists are currently not available. CHICKEN as of version 2.0 supports the abbreviation #` for quasisyntax.

eval-when is not available

Internal define-values is not supported

The following modules are provided:

chicken
All non-standard procedures available in CHICKEN (that is, in the library and eval library units).
chicken-internals
Internally used definitions - you normally don't use this module directly.
chicken-ffi
Macros for interfacing to foreign code.
chicken-macros
Non-standard syntax extensions

Modules with the non-standard extensions provided in separate library units of the core CHICKEN distribution. The tinyclos module exports the define-class, define-generic and define-method syntax. Methods may only be defined on generic functions that have been previously defined with define-generic.

Additional syntax modules for pattern matching and syntax-case. The latter also defines syntax-rules.

To load these modules into your environment, use the require-module form (see below), with the string "-module" added to the name:

 (require-module posix-module)

Toplevel expressions are by default evaluated in a scope that has the scheme and chicken modules imported. Note that module definitions by default only import the bindings of the scheme module.

To load modules into the compile-time/run-time environment, use this special form:

 (require-module MODULENAME)

Loading/linking of separately compiled modules and importing their definitions is strictly separated. To use a separately compiled module, first load it via (require-module ...), then import it.

If you need to create a module for pre-existing libraries, create a wrapper module. The special form import-primitives or import-primitives-for-all allows importing unqualified toplevel identifiers into the current scope:

;;; my-stuff-module.scm

;; add code here to define, include or require the definition of `my-print' ...

(module my-stuff (my-print)      ; exported identifiers
  (import-primitives my-print) )

If you compile this file into a shared library, you can load the module by invoking

 (require-module my-stuff)

and import it's definitions via

 (import my-stuff)

Extensions:

[syntax] (define-for-syntax ...)

Identical to (begin-for-syntax (define ...)).

This extension is still in an experimental stadium.

Changelog

License

 Copyright (C) Andre van Tonder (2005). All Rights Reserved.
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 
 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.