- R7RS Tasks
- General structure
- Todo
- Classification of changes
- Currently unimplemented changes
- List of R7RS features that are provided by the r7rs egg
- 2.1. Identifiers
- 4.1.7. Inclusion
- 4.2.1. Conditionals
- 4.3.2. Pattern language (syntax-rules)
- 5.2. Import declarations
- 5.5. Record-type definitions
- 6.3. Booleans
- 6.4. Pairs and lists
- 6.6. Characters
- 6.7. Strings
- 6.7. Strings
- 6.8. Vectors
- 6.10. Control features
- 6.12. Environments and evaluation
- 6.13.1. Ports
- 6.13.3. Output
- 6.14. System interface
R7RS Tasks
General structure
The r7rs egg has been implemented and provides basic support for R7RS features not already implemented in the core system. There are still a number of incompatibilities and some missing functionality.
Open is also whether more features should move to the core system or whether support of the language as an egg provides integration enough to not annoy users who simply want to code in R7RS with minimal effort.
The remaining document tries to reflect the current status of R7RS Scheme support on CHICKEN.
comments by John Cowan marked with JC:
Todo
Outstanding tasks:
- \x escapes in |...|
- #\x...; character syntax
- export renaming
- eqv? corner cases (probably not, see below)
- equal? must not diverge
- with-exception-handler thread safety
- Feature identifiers as in Appendix B (see below)
Nice to haves:
- (srfi 1) and (srfi 13) reexport optimizations
- .inline files
- .types specializations
- #!fold-case support without (import (scheme read))
The egg also needs a more comprehensive test suite.
Classification of changes
- (+)
- Trivial or straightforward changes
- (*)
- Changes that are difficult or work-intensive
- (X)
- Changes that break backwards-compatibility
- (?)
- Needs to be clarified
Currently unimplemented changes
2.1. Identifiers
- |...| needs support for \x...; escape syntax, which is not fully compatible to the existing \xXX format. A backwards-compatible change should be possible but will have ambiguous cases like |\x12;|. (X)
6.7. Strings
- \x...; syntax. The same issues as in |...| identifier names. (X)
Appendix B
- Without a canonical list of features and their exact meaning this is mostly useless.
- JC: The ones that CHICKEN should provide (as symbols, not as keywords) are: (+)
- r7rs
- ieee-float
- exact-closed, exact-complex, ratios (not in CHICKEN 4 unless the numbers-egg is loaded, perhaps not even then),
- full-unicode
- the values of (machine-byte-order), (machine-type), (software-type) (with posix instead of unix), and (software-version)
- FW: This should be implemented in the core system (+)
- JC: The ones that CHICKEN should provide (as symbols, not as keywords) are: (+)
5.6.1. Library syntax
- The export declaration will require renaming, which is currently not available in the module system. Requires a bit of work. (*)
- (include "filename") takes filename to be relative to the current directory. Other R7RS implementations interpret filename relative to the file containing the include.
6.1. Equivalence predicates
- eqv? may have some corner cases for funny IEEE values (nan, etc.). (?)
- JC: Not that I can see: (eqv +nan.0 +nan.0) can return either #t or #f in R7RS.
- equal? must handle circular data. Change this in core? Probably, since this needs to be fast. Applies to equal=? as well.
6.11. Exceptions
- with-exception-handler. I think this is not compatible to the current version. (? *)
- Clarify exact semantics of raise. (? *)
- JC: Same as Chicken's abort.
- Implementing guard correctly will need some thought, due to the wild jumping between dynamic environments. (*)
- JC: It's actually very close to Chicken's handle-exception.
List of R7RS features that are provided by the r7rs egg
2.1. Identifiers
- #!fold-case, #!no-fold-case.
4.1.7. Inclusion
- Multi-argument include, include-ci.
4.2.1. Conditionals
- cond-expand support for library.
4.3.2. Pattern language (syntax-rules)
- "Underscores also match arbitrary input elements but are not pattern variables ..."
- (<ellipsis> <template>). This is currently not available, IIRC.
5.2. Import declarations
- import. A library name may not begin with a modifier-keyword like only.
5.5. Record-type definitions
- define-record-type, generative.
6.3. Booleans
- #true, #false
6.4. Pairs and lists
- make-list. See SRFI-1.
- 3-argument member and assoc. See SRFI-1.
6.6. Characters
- char-foldcase currently only supports ASCII
- Extend char=?, char<? et al. to accept arbitrarily many arguments
6.7. Strings
- Extend string=?, string<? et al. to accept arbitrarily many arguments.
6.7. Strings
- string->list with start/end arguments.
- string-copy, string-copy! and string-fill! with start/end arguments. See SRFI-13.
6.8. Vectors
- vector->list, list->vector and string->vector with start/end arguments. Provide specializations.
- vector-copy! and vector-fill! with start/end arguments.
6.10. Control features
- string-map and string-for-each are not compatible with SRFI-13 version.
6.12. Environments and evaluation
- environment.
6.13.1. Ports
- get-output-string.
6.13.3. Output
- write-string with start/end arguments.
- write. Support for labels and circle-detection.
6.14. System interface
- 2-argument load.
- exit with boolean arguments.