Thanks! That fixed it!<br><br>Although I'm still curious as to why the error happens in the first place.<br><div class="gmail_quote">On Thu Nov 06 2014 at 3:32:02 PM Alexander D. Knauth <<a href="mailto:alexander@knauth.org">alexander@knauth.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I think I had a similar sort of problem about a year ago (I was at either RacketCon or a Hackathon that same weekend and Mathew Flatt figured it out), and the solution was changing (only-in path a) to (only-in path [a a]).<br>
<br>
#lang racket/load<br>
;;provider<br>
(module T racket<br>
(provide a)<br>
(define a 1))<br>
;; requirer<br>
(module R racket<br>
(require (for-syntax syntax/parse))<br>
(define-syntax (test-binding stx)<br>
(syntax-parse stx<br>
[(_ path)<br>
#'(let () (local-require (only-in path [a a])) a)]))<br>
(test-binding 'T))<br>
;; go<br>
(require ‘R)<br>
<br>
<br>
On Nov 6, 2014, at 4:09 PM, Spencer Florence <<a href="mailto:spencer@florence.io" target="_blank">spencer@florence.io</a>> wrote:<br>
<br>
> Hi All,<br>
><br>
> I've been struggling to have a macro be given a path then require something from that path. The following code produces and "Unbound Identifier" error, although I would expect it to evaluate to 1. Could someone provide insight into what is going on?<br>
><br>
> #lang racket/load<br>
> ;;provider<br>
> (module T racket<br>
> (provide a)<br>
> (define a 1))<br>
> ;; requirer<br>
> (module R racket<br>
> (require (for-syntax syntax/parse))<br>
> (define-syntax (test-binding stx)<br>
> (syntax-parse stx<br>
> [(_ path)<br>
> #'(let () (local-require (only-in path a)) a)]))<br>
> (test-binding 'T))<br>
> ;; go<br>
> (require 'R)<br>
><br>
><br>
> P.S. I attempted to do this with `dynamic-require,` but that failed because in my actual program `path` is sometimes `(submod "..")`, which caused an error about not having a base path.<br>
><br>
> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/<u></u>users</a><br>
<br>
</blockquote></div>