mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Cache symbols instead of computing them each time
This commit is contained in:
parent
516c13c6df
commit
821e04eb34
1 changed files with 8 additions and 4 deletions
|
@ -22,6 +22,10 @@
|
|||
Cyc-opaque-unsafe-string->number)
|
||||
(begin
|
||||
|
||||
(define *sym-dot* (string->symbol "."))
|
||||
(define *sym-unquote-splicing* (string->symbol ",@"))
|
||||
(define *sym-datum-comment* (string->symbol "#;"))
|
||||
|
||||
(define-syntax include
|
||||
(er-macro-transformer
|
||||
(lambda (expr rename compare)
|
||||
|
@ -46,7 +50,7 @@
|
|||
(define (->dotted-list lst)
|
||||
(cond
|
||||
((null? lst) '())
|
||||
((equal? (car lst) (string->symbol "."))
|
||||
((equal? (car lst) *sym-dot*)
|
||||
(cadr lst))
|
||||
(else
|
||||
(cons (car lst) (->dotted-list (cdr lst))))))
|
||||
|
@ -141,7 +145,7 @@
|
|||
(read-error fp "missing closing parenthesis"))
|
||||
((Cyc-opaque-eq? t #\))
|
||||
(if (and (> (length lis) 2)
|
||||
(equal? (cadr lis) (string->symbol ".")))
|
||||
(equal? (cadr lis) *sym-dot*))
|
||||
(->dotted-list (reverse lis))
|
||||
(reverse lis)))
|
||||
(else
|
||||
|
@ -182,9 +186,9 @@
|
|||
(apply bytevector (reverse lis)))
|
||||
(else
|
||||
(loop (cons t lis) (parse fp))))))
|
||||
((eq? token (string->symbol ",@"))
|
||||
((eq? token *sym-unquote-splicing*)
|
||||
(list 'unquote-splicing (parse fp)))
|
||||
((eq? token (string->symbol "#;"))
|
||||
((eq? token *sym-datum-comment*)
|
||||
(parse fp) ;; Ignore next datum
|
||||
(parse fp))
|
||||
;; Other special cases?
|
||||
|
|
Loading…
Add table
Reference in a new issue