Skip to content

Commit

Permalink
add disabled test for syntax-rules identifiers #43
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Aug 20, 2020
1 parent 14c88d8 commit 7bf2d50
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -581,3 +581,28 @@

(t.is (test 1 2 3) '((1 . ...) (2 . ...) (3 . ...)))
(t.is (test) '((1 . ...) (2 . ...)))))


(test_ "syntax-rules: it should handle identifiers"
(lambda (t)

(define-syntax for
(syntax-rules (in as)
((for element in list body ...)
(map (lambda (element)
body ...)
list))
((for list as element body ...)
(for element in list body ...))))

(t.is (let ((result '()))
(for i in '(0 1 2 3 4)
(set! result (cons i result)))
result)
'(4 3 2 1 0))

(t.is (let ((result '()))
(for '(0 1 2 3 4) as i
(set! result (cons i result)))
result)
'(4 3 2 1 0))))

0 comments on commit 7bf2d50

Please sign in to comment.