apparently undefined function called by macro



I'm using the following simple system:

; foo.asd

(defpackage :foo-system (:use :asdf :cl))
(in-package :foo-system)

(defsystem foo
:components
((:file "packages")
(:file "foo" :depends-on ("packages"))))

; packages.lisp

(in-package :cl-user)

(defpackage :foo
(:use :common-lisp))

; foo.lisp

(in-package :foo)

;(eval-when (:load-toplevel :compile-toplevel :execute)
(defun id (x) x)
;)

(defmacro define-foo-class (name slots)
`(defclass ,name ()
,(mapcar #'id slots)))

(define-foo-class bar
((baz :initarg :baz :accessor baz)
(quux :initarg :quux :accessor quux)))

If I try to load it in a fresh image, clisp complains about undefined id:

[1]> (asdf:oos 'asdf:load-op :foo)
; loading system definition from foo.asd into #<PACKAGE ASDF0>
;; Loading file foo.asd ...
; registering #<SYSTEM FOO #x102A2839> as FOO
;; Loaded file foo.asd
;; Compiling file /tmp/asdf/packages.lisp ...
;; Wrote file /tmp/asdf/packages.fas
;; Loading file /tmp/asdf/packages.fas ...
;; Loaded file /tmp/asdf/packages.fas
;; Compiling file /tmp/asdf/foo.lisp ...
*** - FUNCTION: undefined function ID
[...]

Loading by hand, i.e., (progn (load "packages.lisp") (load "foo.lisp")),
is no problem, and as you can guess from the commented lines, wrapping
ID in EVAL-WHEN is also a workaround.

Well, hmm, my misunderstanding is more basic than ASDF or even the
reader. After removing the initial IN-PACKAGE form from foo.lisp,
COMPILE-FILE still complains about undefined ID.

Why is ID undefined? Please help me correct the error in my mental
model.

Thanks,
Greg
.