[racket] compile time (file read -> define function)

From: Sean Kanaley (skanaley at gmail.com)
Date: Thu Apr 24 20:17:50 EDT 2014

I have:

1. a macro to define functions

(define-syntax the-macro
  #'(define (name) ...))

2. a file filled with "user" definitions in expression form

(this is a definition that shall be passed to the macro)
(so is this)

3. I would like to do something to the effect of

(define-namespace-anchor nsa)
(with-input-from-file ...
  (λ ()
    (eval `(the-macro ,@(read))
            (namespace-anchor->namespace nsa))))

which works, but then I cannot provide the defined functions as they happen
at phase runtime compile shift meta 34 (?).  Is there some way to sort of
pre-run the file reading so the definitions already exist for exporting?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140424/7707e7fb/attachment.html>

Posted on the users mailing list.