Possible macroexpansion bug
Peter Minten <[email protected]> Tue, 27 Apr 2004 19:25:53 +0200
| Newsgroups | gmane.lisp.movitz.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I've put up a new version of the harddisk code
(http://www.il.fontys.nl/~silvernerd/harddisk.lisp), featuring a complete code
rewrite (as usual :-). The problem is, it doesn't compile due to some weird
macroexpansion that somehow turns the io-port code in define-register-accessors
(invoked with clauses of (name offset type)) into (io-port (+ ... type)). I
checked with CMUCL macroexpand-1 and it doesn't expand that way there.
Note that I slightly modified the code after the last test, so there may be
other errors coming first, but since those modifications are lower in the file
(and consist only of renaming to the new naming scheme) I doubt it.
(defmacro define-register-accessors (&rest clauses)
(let ((gs-hdc (gensym "hdc-")))
`(progn
,@(mapcar #'(lambda (clause)
`(defmacro
,(intern (concatenate 'string
(string (first clause))
(string '-register)))
(,gs-hdc)
`(io-port (+ (slot-value ,,gs-hdc 'command-base)
,,(second clause))
,,(third clause))))
clauses))))
Greetings,
Peter