van Tonders macro and module system.
Note: This extension is currently unsupported. A new version has been released and the maintenance status is unclear.
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:
- All non-standard procedures available in CHICKEN (that is, in the library and eval library units).
- Internally used definitions - you normally don't use this module directly.
- Macros for interfacing to foreign code.
- 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:
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:
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
and import it's definitions via
Extensions:[syntax] (define-for-syntax ...)
Identical to (begin-for-syntax (define ...)).
This extension is still in an experimental stadium.
- 2.12 Added define-for-syntax
- 2.11 Added missing hash-table-ref/default to extras-module
- 2.1 Adapted to current official version
- 2.01 Added implementation of import-primitives by André van Tonder
- 2.0 Ported to new version; various improvements
- 0.9.5 Added documentation to egg; fixed bugs in define-macro and include
- 0.9.4 Added rec (SRFI-31), removed hash-table-count (frome extras module)
- 0.9.3 Several fixes by Dale Jordan
- 0.9.2 regex and posix modules were not built, changed define-primitive-module to work on systems where libffi isn't used (i.e. works around argument limit) [Thanks to Dale Jordan]
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.