Add implementation of SRFI 31.

This commit is contained in:
sperber 2003-02-28 13:05:04 +00:00
parent 7ab2c69a6d
commit 5788fb4790
3 changed files with 18 additions and 2 deletions

View File

@ -548,6 +548,9 @@
random-source-make-integers
random-source-make-reals))
(define-interface srfi-31-interface
(export (rec :syntax)))
(define-interface srfi-37-interface
(export
option

View File

@ -729,7 +729,7 @@
(define available-srfis
'(srfi-1 srfi-2 srfi-5 srfi-6 srfi-7 srfi-8 srfi-9
srfi-11 srfi-13 srfi-14 srfi-16 srfi-17 srfi-23
srfi-25 srfi-26 srfi-27 srfi-28 srfi-30))
srfi-25 srfi-26 srfi-27 srfi-28 srfi-30 srfi-31))
; Some SRFI's redefine Scheme variables.
(define shadowed
@ -854,6 +854,10 @@
; SRFI-30 - scheme/rts/read.scm contains the reader for #|...|# comments
(define-structure srfi-31 srfi-31-interface
(open scheme)
(files (srfi srfi-31)))
(define-structure srfi-37 srfi-37-interface
(open scheme
srfi-9
@ -946,7 +950,7 @@
srfi-1 srfi-2 srfi-5 srfi-6 srfi-7 srfi-8 srfi-9
srfi-11 srfi-13 srfi-14 srfi-16 srfi-17
srfi-23 srfi-25 srfi-26 srfi-27 srfi-28
srfi-37
srfi-31 srfi-37
)
:structure)
((define-signature define-package) :syntax)))

9
scheme/srfi/srfi-31.scm Normal file
View File

@ -0,0 +1,9 @@
; Taken directly from the SRFI document.
(define-syntax rec
(syntax-rules ()
((rec (NAME . VARIABLES) . BODY)
(letrec ( (NAME (lambda VARIABLES . BODY)) ) NAME))
((rec NAME EXPRESSION)
(letrec ( (NAME EXPRESSION) ) NAME))))