Fixing unquote-splicing in srfi-38.

This commit is contained in:
Alex Shinn 2012-11-03 23:37:41 +09:00
parent 90856b8de2
commit 195cbeca6d

View file

@ -161,8 +161,8 @@
(if (and (not (eof-object? c)) (if (and (not (eof-object? c))
(or (char-numeric? c) (or (char-numeric? c)
(memv (char-downcase c) '(#\a #\b #\c #\d #\e #\f)))) (memv (char-downcase c) '(#\a #\b #\c #\d #\e #\f))))
(read-label (cons (read-char in) res)) (read-label (cons (read-char in) res))
(list->string (reverse res))))) (list->string (reverse res)))))
(define (read-number base) (define (read-number base)
(let* ((str (read-label '())) (let* ((str (read-label '()))
(n (string->number str base)) (n (string->number str base))
@ -344,10 +344,10 @@
((#\`) (read-char in) (list 'quasiquote (read-one))) ((#\`) (read-char in) (list 'quasiquote (read-one)))
((#\,) ((#\,)
(read-char in) (read-char in)
(list (if (eqv? #\@ (peek-char in)) (let ((sym (if (eqv? #\@ (peek-char in))
(begin (read-char in) 'unquote-splicing) (begin (read-char in) 'unquote-splicing)
'unquote) 'unquote)))
(read-one))) (list sym (read-one))))
(else (else
(read in)))) (read in))))
;; body ;; body