From a6a52817ffd22776c3efe5bd863346f874bb9d52 Mon Sep 17 00:00:00 2001 From: zaoqi Date: Sat, 21 Oct 2017 11:50:01 +0800 Subject: [PATCH] fix --- zscm.rkt | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/zscm.rkt b/zscm.rkt index c64e254..3cbea19 100644 --- a/zscm.rkt +++ b/zscm.rkt @@ -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 @@ -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)