I tried it with only-in instead of rename-in and it worked: #lang racket (let () (local-require (only-in racket [string rkt:string])) ;;=> 3:28: syntax: misplaced ellipsis in template at: ... in: ... (rkt:string #\a #\b)) ;;=> "ab"
On Nov 28, 2013, at 9:32 AM, Greg Hendershott wrote:
It looks like there's a corner case where `local-require` does not work -- with non-simple require specs such as `rename-in` or `prefix-in`, AND where the module is the #lang module. This works with normal require: #lang racket (require (rename-in racket [string rkt:string])) (rkt:string #\a #\b) ;=> "ab" But this does not: #lang racket (let () (local-require (rename-in racket [string rkt:string])) ;;=> 3:28: syntax: misplaced ellipsis in template at: ... in: ... (rkt:string #\a #\b)) Something like... #lang racket (let () (local-require (rename-in net/url [get-pure-port foo])) ... ...does compile OK. So it seems specific to it being the #lang or perhaps specific to `racket`. I'll report this as a not-critical bug. (Even if it's not a bug in the sense that there's a good reason why it ought not to work? The error message could be better and/or the docs for local-require might explain this.) ____________________ Racket Users list: http://lists.racket-lang.org/users
____________________ Racket Users list: http://lists.racket-lang.org/users