Re: Compilation order when compiling and loading a file



Den Fri, 30 Nov 2007 05:47:32 -0800 skrev peter.hildebrandt@xxxxxxxxx:

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)

Works perfectly fine for me (although it doesn't actually print anything
if you don't execute (load "helper.lisp") at REPL, but with --eval).

Cheers,
Maciej
.



Relevant Pages

  • Compilation order when compiling and loading a file
    ... defmacro a macro which uses the helper function ...
    (comp.lang.lisp)
  • Re: Pass an array to Rank
    ... That could be done but it would have to done every time the data changes. ... macro could also be used but the macro would have to run every time the data ... > Biff wrote: ... >> easily but it takes 2 helper columns. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: [PATCH 9/14] FRV: CONFIG_MMU fixes
    ... this is a real ifdef mess, let's sort this out better (aka on file ... move this into a helper function that can be compiled away for the!MMU case ... add a small helper for this. ...
    (Linux-Kernel)
  • Re: picture in data grid based on value
    ... #Data Binding Expression Syntax ... As for your situation, first, we define a helper function in the page class: ... the helper function take an object param because the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: [PATCH] xfs: reduce stack usage in xfs_bmap_btalloc()
    ... This patch reduces xfs_bmap_btallocstack usage by 50 bytes ... by moving part of its body into a helper function. ... The helper itself does not call anything stack-deep. ...
    (Linux-Kernel)