Ditch the syntax-case version of identifier-syntax now it’s in core

This commit is contained in:
Daphne Preston-Kendal 2022-02-04 10:35:11 +01:00
parent d6b13db503
commit 51b0203dc5
2 changed files with 1 additions and 25 deletions

View file

@ -381,29 +381,6 @@
(define-current-ellipsis ellipsis)
. body))))))
;; identifier-syntax adapted from R6RS Libraries section 12.9
;; (changes: use only round brackets; can't use fenders in Chibi
;; syntax-rules; wrap the transformer procedures in make-transformer
;; so they can be used in Chibi anywhere a syntax transformer is
;; used, not just in {define,let,letrec}-syntax)
(define-syntax identifier-syntax
(syntax-rules (set!)
((_ e)
(make-transformer
(lambda (x)
(syntax-case x ()
(id (identifier? #'id) #'e)
((_ x (... ...)) #'(e x (... ...)))))))
((_ (id exp1) ((set! var val) exp2))
#;(and (identifier? #'id) (identifier? #'var))
(make-transformer
(make-variable-transformer
(lambda (x)
(syntax-case x (set!)
((set! var val) #'exp2)
((id x (... ...)) #'(exp1 x (... ...)))
(id (identifier? #'id) #'exp1))))))))
;; Local variables:
;; eval: (put '%define-syntax 'scheme-indent-function 1)
;; End:

View file

@ -4,8 +4,7 @@
datum->syntax syntax->datum
generate-temporaries with-syntax syntax-violation
with-ellipsis ellipsis-identifier?
define-syntax let-syntax letrec-syntax
make-variable-transformer identifier-syntax)
define-syntax let-syntax letrec-syntax)
(import (rename (chibi)
(define-syntax %define-syntax)
(let-syntax %let-syntax)