[racket] errortrace breaks local-require on submodules

From: Alexis King (lexi.lambda at gmail.com)
Date: Mon Jan 12 02:00:36 EST 2015

Okay, new information. I’ve looked into this more, and I’m pretty sure it has nothing at all to do with errortrace. I don’t know why running it from the command line without errortrace works, but as far as I can tell it shouldn’t.

The real problem is that require-local uses syntax-local-lift-require <http://docs.racket-lang.org/reference/stxtrans.html?q=syntax-local-lift-require#(def._((quote._~23~25kernel)._syntax-local-lift-require))>, which pulls the resulting #%require expression into the top of the enclosing module. This means it ends up being before any submodule definitions, so it explodes.

This seems a little like an issue with submodules and syntax-local-lift-require more than anything else. Should submodules be lifted to the top of the module? Either way, this is a frustrating problem, and I can’t see any simple fix.

> On Jan 11, 2015, at 12:55, Alexis King <lexi.lambda at gmail.com> wrote:
> 
> I wrote a typed racket macro that creates an untyped submodule, then uses require/typed to add type annotations to the bindings. This would work great, except that it just errors out and dies. I submitted a bug report before realizing that a bug report already existed <http://bugs.racket-lang.org/query/?cmd=view%20audit-trail&database=default&pr=14130&return_url=http://bugs.racket-lang.org/query/?database=default;debug=;State=any;ignoreclosed=Ignore%20Closed;Synopsis=local-require;multitext=;columns=State;columns=Synopsis;columns=Category;columns=Last-Modified;columns=Release;cmd=submit%20query;sortby=Number>. There, someone suggested that it would work fine with (submod "." foo) instead of simply using 'foo. This works!
> 
> Except that it doesn’t work when errortrace is enabled. This behavior is observable here:
> https://gist.github.com/lexi-lambda/d0da64235e1bca59810f <https://gist.github.com/lexi-lambda/d0da64235e1bca59810f>
> 
> Note that it works fine using plain old require, and it also works fine without errortrace. What is errortrace doing that breaks this specific instance? How can I fix it? I’d really like to be able to solve this because my macro sort of depends on it.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150111/b7e6610f/attachment.html>

Posted on the users mailing list.