Selaa lähdekoodia

Merge pull request #46 from ideal-knee/fix_macro_koan

Fix log-form and log-form-with-value macros.
Stanley Bileschi 10 vuotta sitten
vanhempi
commit
45a4fe0f57
1 muutettua tiedostoa jossa 5 lisäystä ja 5 poistoa
  1. 5 5
      koans/macros.lsp

+ 5 - 5
koans/macros.lsp

@@ -108,10 +108,10 @@
108 108
 
109 109
 (defvar *log* nil)
110 110
 
111
-(defmacro log-form (&body body)
111
+(defmacro log-form (form)
112 112
   "records the body form to the list *log* and then evalues the body normally"
113
-  `(let ((retval ,@body))
114
-     (push ',@body *log*)
113
+  `(let ((retval ,form))
114
+     (push ',form *log*)
115 115
      retval))
116 116
 
117 117
 (define-test test-basic-log-form
@@ -135,11 +135,11 @@
135 135
 (defvar *log-with-value* nil)
136 136
 
137 137
 ;; you must write this macro
138
-(defmacro log-form-with-value (&body body)
138
+(defmacro log-form-with-value (form)
139 139
   "records the body form, and the form's return value
140 140
    to the list *log-with-value* and then evalues the body normally"
141 141
   `(let ((logform nil)
142
-         (retval ,@body))
142
+         (retval ,form))
143 143
 
144 144
      ;; YOUR MACRO COMPLETION CODE GOES HERE.
145 145