From 002f83ea8883fdb3bcdafad16c967b67d9d34ba3 Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan <vu3rdd@gmail.com> Date: Mon, 4 Jun 2012 10:20:28 +0530 Subject: [PATCH] rewrite `quote->cons' using `match'. --- src/sicp/eval-4.33.rkt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sicp/eval-4.33.rkt b/src/sicp/eval-4.33.rkt index 67d821c..ffc7084 100644 --- a/src/sicp/eval-4.33.rkt +++ b/src/sicp/eval-4.33.rkt @@ -253,9 +253,9 @@ (define (quote->cons exp) ;(display (format "q->c: ~s~%" exp)) - (if (null? exp) - '() - (list 'cons (list 'quote (car exp)) (quote->cons (cdr exp))))) + (match exp + [(? null?) '()] + [_ `(cons (quote ,(car exp)) ,(quote->cons (cdr exp)))])) ;; eval (define (eval exp env) -- 2.45.2