Skip to content

Commit

Permalink
unit test for recursive syntax with same symbol #43
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Jan 24, 2024
1 parent 0e07c0a commit d1b1b14
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1196,3 +1196,17 @@
'(foo baz))))

(t.is (foo (a . b)) '(a b))))

(test "syntax: recursive hygiene with same symbol"
(lambda (t)
(define-syntax foo
(syntax-rules (aux)
((_ (arg more ...))
(foo aux (arg more ...) ()))
((_ aux () ((operand1 arg1) ...))
(let ((arg1 operand1) ...)
(list arg1 ...)))
((_ aux (operand1 operand2 ...) (temp ...))
(foo aux (operand2 ...) (temp ... (operand1 arg1))))))

(t.is (foo (10 20)) '(10 20))))

0 comments on commit d1b1b14

Please sign in to comment.