Skip to content
This repository has been archived by the owner on Jan 28, 2018. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zaoqi committed Oct 21, 2017
1 parent 0cfebdd commit a6a5281
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions zscm.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,9 @@
(define (EVALmacro x)
(let ([x (macroexpand x)])
(if (pair? x)
(cons (EVALmacro (car x)) (EVALmacro (cdr x)))
(if (eq? (car x) 'quote)
x
(cons (EVALmacro (car x)) (EVALmacro (cdr x))))
x)))
(define (macroexpand x)
(cond
Expand All @@ -645,17 +647,7 @@
[(and (pair? x) (hash-ref ms (car x) #f)) => (λ (mf) (macroexpand (apply mf (cdr x))))]
[else x]))
(define pre
'((defmacro gensymmacro
(λ xs
(let ([s (if (null? xs)
"g"
(if (and (pair? s) (null? (cddr s)) (eq? (car s) 'quote))
(symbol->string (cadr s))
(if (string? s)
s
(error "gensym"))))])
(gensym s))))
(defmacro struct
'((defmacro struct
(λ (name fs . conf)
`(define-record-type ,name
(,name ,@fs)
Expand Down

0 comments on commit a6a5281

Please sign in to comment.