Compilation order when compiling and loading a file
- From: "peter.hildebrandt@xxxxxxxxx" <peter.hildebrandt@xxxxxxxxx>
- Date: Fri, 30 Nov 2007 05:47:32 -0800 (PST)
Hello *,
I'd like to do the following within one file
- defun a helper function
- defmacro a macro which uses the helper function
- use the macro
Just like this
-----------
(in-package :common-lisp-user)
(defun helper (p)
`(print ,p))
(defmacro my-macro (a)
(helper a))
(my-macro 'done)
------------
However, at the time my-macro is compiled, it complains about helper
being undefined. (In case it matters: This happens in SBCL 1.0.11
with today's slime cvs)
Is there a way to make sure helper is defined when the expansion of
(my-macro ...) is compiled? (other than splitting the source into
two files and using e.g. asdf:defsystem)
Any hints are highly appreciated.
Peter
.
- Follow-Ups:
- Re: Compilation order when compiling and loading a file
- From: Rainer Joswig
- Re: Compilation order when compiling and loading a file
- From: Maciej Katafiasz
- Re: Compilation order when compiling and loading a file
- From: Edi Weitz
- Re: Compilation order when compiling and loading a file
- Prev by Date: Re: The origins of CL conditions system
- Next by Date: Re: Compilation order when compiling and loading a file
- Previous by thread: printing circular data structures
- Next by thread: Re: Compilation order when compiling and loading a file
- Index(es):
Relevant Pages
|