Description

Andre van Tonders macro and module system, with R6RS (draft) / SRFI-83 compliant libraries

This extension is currently unsupported.

Author

Andre van Tonder, some work on the CHICKEN port by felix

Version

Usage

(require-extension r6rs-libraries)

Download

r6rs-libraries.egg

Documentation

For detailed specifications consult the official SRFI documents:

SRFI-72
SRFI-83
Portable modules

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

import loads separately compiled libraries automatically. The predefined modules are handled specially since they are bundled in a separate shared object. Other modules are loaded via require by prepending the URI-scheme to the library name (if existing) and converting the library name to a symbol. So for example (import "scheme://syntax-case") would be required as scheme-syntax-case.

Toplevel expressions are by default evaluated in a scope that has the scheme://chicken library imported.

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

This extension is still in an experimental stadium.

Languages

Basically any library may be used as the "language" part (the second argument) of a library definition, but it must be available both at compile and run-time. Pre-defined languages are:

library: scheme://chicken

Contains all R5RS and non-standard procedures provided by the basic CHICKEN system, that is everything contained in the library and eval library units.

library: scheme://r6rs

R5RS procedures and syntax, including scheme://syntax-case and SRFI-83.

Other libraries

library: chicken://macros

Non-standard syntax extensions. Note that eval-when is not available and internal define-values is not supported)

library: chicken://ffi

Macros for interfacing to foreign code.

library: chicken://extras
library: chicken://lolevel
library: chicken://posix
library: chicken://regex
library: chicken://tinyclos
library: chicken://utils

Non-standard extensions of the CHICKEN system.

The chicken://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.

library: scheme://syntax-case
library: scheme://srfi-1
library: scheme://srfi-4
library: scheme://srfi-13
library: scheme://srfi-14
library: scheme://srfi-18

Modules with SRFI functionality.

scheme://syntax-case provides the syntax-case macro and also definessyntax-rules.

Extensions

macro: (define-for-syntax ...)
Identical to (begin-for-syntax (define ...)). Exported by the scheme://chicken and scheme://r6rs libraries.
macro: (import-primitives IDENTIFIER ...)
Imports the given identifiers unadorned into the current library. This provides a kind of"backdoor" for accessing internal identifiers or identifiers that are not defined in a library.

License

Copyright (c) 2005 Andre van Tonder

  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.