mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-21 06:39:16 +02:00
27 lines
620 B
Scheme
27 lines
620 B
Scheme
(import (scheme base) (scheme write))
|
|
|
|
;; (let-syntax ((given-that (syntax-rules ()
|
|
;; ((given-that test stmt1 stmt2 ...)
|
|
;; (if test
|
|
;; (begin stmt1
|
|
;; stmt2 ...))))))
|
|
;; (let ((if #t))
|
|
;; (given-that if (set! if 'now))
|
|
;; if)) ;; => now
|
|
|
|
(write
|
|
(let ((x 'outer))
|
|
(let-syntax ((m (syntax-rules () ((m) x))))
|
|
(let ((x 'inner))
|
|
(m)))) ;; Should be outer
|
|
)
|
|
|
|
;(write
|
|
;(let ((x 'outer))
|
|
; (define-syntax m ;; Testing this out, but let-syntax needs to work, too
|
|
; (syntax-rules () ((m) x)))
|
|
; (let ((x 'inner))
|
|
; (m))) ;; Should be outer
|
|
; )
|
|
;
|
|
;(write (m)) ;; Should be an error, of course
|