chickadee » srfi-7

Outdated egg!

This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

srfi-7

Description

Feature-based program configuration language

Author

Richard Kelsey, ported to chicken by felix-winkelmann.

Requirements

None

Documentation

(program PROGRAM-CLAUSE ...)syntax

Expands into a program according to the specifications given in PROGRAM-CLAUSE ....

Syntax

 <program> --> (program <program clause>+)
 <program clause>
   --> (requires <feature identifier>+)
     | (files <filename>*)
     | (code <Scheme expression, definition, or syntax definition>*)
     | (feature-cond <feature-cond clause>+)
     | (feature-cond <feature-cond clause>* (else <program clause>+))
 <feature-cond clause>
   --> (<feature requirement> <program clause>+)
 <feature requirement>
   --> <feature identifier>
     | (and <feature requirement>*)
     | (or <feature requirement>*)
     | (not <feature requirement>)
 <feature identifier>
   --> a symbol which is the name of a SRFI

Semantics

The meanings of the different <program> clauses are given below. The ordering of the clauses in a <program> determines the order of the forms in the resultant Scheme program.

(requires <feature-identifier>+)
The listed features are required by the program. If one or more is not provided by the implementation the program cannot be run.
(files <filename>*)
The listed files are included and the forms they contain added to the program.
(code <body>)
The forms in <body> are added to the program.
(feature-cond <feature-cond clause>+)
The meaning of a FEATURE-COND clause is that of the <program-clause>s in the first <feature-cond clause> whose <implementation-requirement> is satisfied by the implementation. If an ELSE clause is present it is used if and only if no preceding clause is satisfied; a FEATURE-COND with an ELSE clause is always satisfied.

If no clause can be satisified the <program> cannot be evaluated in the implementation.

The meaning of the <implementation requirement>s is as follows:

<feature identifier>satisfied if the feature is present
(and)always satisfied
(and x ...)satisfied if every X is satisfied
(or)never satisfied
(or x ...)satisfied if any X is satisfied
(not x)satisfied if X is not satisfied

See also: http://srfi.schemers.org/srfi-7/srfi-7.html

History

License

 Copyright (C) Richard Kelsey (1999). All Rights Reserved.
 This document and translations of it may be copied and furnished to
 others, and derivative works that comment on or otherwise explain it
 or assist in its implementation may be prepared, copied, published and
 distributed, in whole or in part, without restriction of any kind,
 provided that the above copyright notice and this paragraph are
 included on all such copies and derivative works. However, this
 document itself may not be modified in any way, such as by removing
 the copyright notice or references to the Scheme Request For
 Implementation process or editors, except as needed for the purpose of
 developing SRFIs in which case the procedures for copyrights defined
 in the SRFI process must be followed, or as required to translate it
 into languages other than English.
 
 The limited permissions granted above are perpetual and will not be
 revoked by the authors or their successors or assigns.
 
 This document and the information contained herein is provided on an
 ``AS IS'' basis and THE AUTHOR AND THE SRFI EDITORS DISCLAIM ALL
 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
 WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY
 RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
 PARTICULAR PURPOSE.

Contents »