mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-25 13:05:05 +02:00
More examples
This commit is contained in:
parent
19ee3de542
commit
29739bc731
1 changed files with 34 additions and 0 deletions
|
@ -33,6 +33,40 @@
|
||||||
(define internal-def 'ok))
|
(define internal-def 'ok))
|
||||||
internal-def)
|
internal-def)
|
||||||
|
|
||||||
|
;; From Husk:
|
||||||
|
;;
|
||||||
|
; Examples from the source to R5RS pitfall 3.3
|
||||||
|
;; (assert/equal
|
||||||
|
;; (let ((a 1))
|
||||||
|
;; (letrec-syntax
|
||||||
|
;; ((foo (syntax-rules ()
|
||||||
|
;; ((_ b)
|
||||||
|
;; (bar a b))))
|
||||||
|
;; (bar (syntax-rules ()
|
||||||
|
;; ((_ c d)
|
||||||
|
;; (cons c (let ((c 3))
|
||||||
|
;; (list d c 'c)))))))
|
||||||
|
;; (let ((a 2))
|
||||||
|
;; (foo a))))
|
||||||
|
;; '(1 2 3 a))
|
||||||
|
;;
|
||||||
|
;; ; Examples from/based on pitfall 8.3 (assert/equal 1
|
||||||
|
;; (let ((x 1))
|
||||||
|
;; (let-syntax ((foo (syntax-rules () ((_) 2))))
|
||||||
|
;; (define x (foo))
|
||||||
|
;; 3)
|
||||||
|
;; x))
|
||||||
|
;; (assert/equal 1
|
||||||
|
;; (let ((x 1))
|
||||||
|
;; (letrec-syntax ((foo (syntax-rules () ((_) 2)))) (define x (foo))
|
||||||
|
;; 3)
|
||||||
|
;; x))
|
||||||
|
;;
|
||||||
|
;; ; Issue #151 - Preserve hygiene across syntax-rules and ER macros
|
||||||
|
;; (assert/equal
|
||||||
|
;; (let ((unquote 'foo)) `(,'bar))
|
||||||
|
;; '(,'bar))
|
||||||
|
|
||||||
|
|
||||||
#;(let ((a 1))
|
#;(let ((a 1))
|
||||||
(let-syntax
|
(let-syntax
|
||||||
|
|
Loading…
Add table
Reference in a new issue