This commit is contained in:
Justin Ethier 2017-11-19 19:01:14 -05:00
parent 8750696e17
commit 24fc89f320

View file

@ -1,4 +1,4 @@
(import (scheme base)) (import (scheme base) (scheme write))
;; (let-syntax ((given-that (syntax-rules () ;; (let-syntax ((given-that (syntax-rules ()
;; ((given-that test stmt1 stmt2 ...) ;; ((given-that test stmt1 stmt2 ...)
@ -9,7 +9,17 @@
;; (given-that if (set! if 'now)) ;; (given-that if (set! if 'now))
;; if)) ;; => now ;; if)) ;; => now
;;(let ((x 'outer))
;; (let-syntax ((m (syntax-rules () ((m) x))))
;; (let ((x 'inner))
;; (m)))) ;; Should be outer
(write
(let ((x 'outer)) (let ((x 'outer))
(let-syntax ((m (syntax-rules () ((m) x)))) (define-syntax m ;; Testing this out, but let-syntax needs to work, too
(syntax-rules () ((m) x)))
(let ((x 'inner)) (let ((x 'inner))
(m)))) ;; Should be outer (m))) ;; Should be outer
)
(write (m)) ;; Should be an error, of course