* Added datum->syntax and syntax->datum

This commit is contained in:
Abdulaziz Ghuloum 2007-05-11 22:50:02 -04:00
parent 6e1c1f847a
commit 6fe22073dd
3 changed files with 13 additions and 2 deletions

Binary file not shown.

View File

@ -8,7 +8,8 @@
(library (ikarus syntax)
(export identifier? syntax-dispatch environment environment?
eval generate-temporaries free-identifier=?
bound-identifier=? syntax-error
bound-identifier=? syntax-error datum->syntax
syntax->datum
eval-r6rs-top-level boot-library-expand eval-top-level)
(import
(r6rs)
@ -2276,6 +2277,14 @@
(apply string-append args)
(strip x '()))))
(define identifier? (lambda (x) (id? x)))
(define datum->syntax
(lambda (id datum)
(if (id? id)
(datum->stx id datum)
(error 'datum->syntax "~s is not an identifier" id))))
(define syntax->datum
(lambda (x) (stx->datum x)))
(define eval-r6rs-top-level
(lambda (x*)
(let-values ([(lib* invoke-code) (top-level-expander x*)])

View File

@ -408,7 +408,9 @@
[syntax-error i syncase]
[generate-temporaries i syncase]
[free-identifier=? i syncase]
[bound-identifier=? i syncase]
[bound-identifier=? i syncase]
[syntax->datum i syncase]
[datum->syntax i syncase]
[code? i]
[immediate? i]
[pointer-value i]