quoted pairs or vectors are compiled to runtime cons or vector

This commit is contained in:
Yuichi Nishiwaki 2017-04-06 20:34:13 +09:00
parent 1e345d8228
commit 7f430e000b
2 changed files with 595 additions and 585 deletions

File diff suppressed because it is too large Load Diff

View File

@ -275,7 +275,12 @@
(define-transformer 'quote (define-transformer 'quote
(lambda (form env) (lambda (form env)
(if (= (length form) 2) (if (= (length form) 2)
`(,the-core-quote ,(cadr form)) (let ((obj (cadr form)))
(cond
((pair? obj) `(,(the 'cons) (,the-quote ,(car obj)) (,the-quote ,(cdr obj))))
((vector? obj) `(,(the 'vector) . ,(vector->list
(vector-map (lambda (obj) `(,the-quote ,obj)) obj))))
(else `(,the-core-quote ,obj))))
(error "malformed quote" form)))) (error "malformed quote" form))))
(define-transformer 'if (define-transformer 'if