1. Thanks for figuring this out!

2. I'm pushing a commit to utilize this.

3. I wanted to link to your post in my commit message -- but I can't.
When I type this, your post isn't showing up in the Google Groups UI
for this thread --
https://groups.google.com/forum/#!topic/racket-users/ANgDaNplOBc .
John, is it stuck in moderation?


On Mon, May 18, 2015 at 9:46 AM, Sam Tobin-Hochstadt
<sa...@cs.indiana.edu> wrote:
> I've now figured out what's going on here. The program in Greg's tests
> already has lexical context for the `{0 1 2}`, so it uses the `#%app` from
> that context, which gets the `racket` `#%app`. Normally, we'd just use
> s-exps instead of syntax objects as input to `eval`, since they don't have
> spurious lexical context, but that would lose the 'paren-shape property,
> which is crucial here. The solution, taken from the implementation of
> `racket/load`, is below:
>
> ```
> #lang racket
> (require syntax/strip-context)
> (current-namespace (make-base-namespace))
> (eval (namespace-syntax-introduce (strip-context #'(module m rackjure {0 1
> 2}))))
> ```
>
> Sam
>
> On Fri, May 15, 2015 at 3:47 PM Sam Tobin-Hochstadt <sa...@cs.indiana.edu>
> wrote:
>>
>> It turns out that Greg's test was actually failing, but in a very strange
>> way. Having looked at this a bunch now, the issue seems to be that:
>>
>> ```
>> (check-exn exn:fail:syntax? (λ () (eval #'(module m rackjure  {0 1 2}))))
>> ```
>>
>> Doesn't work inside a module, but it does work at the repl or in
>> `racket/load`. However, no namespace trickery that I've found will make it
>> work in a module.
>>
>> However, changing the syntax error to something different, such as
>> `(module m rackjure ())`, behaves as I would expect. Does `eval` +
>> `quote-syntax` do something strange with {} properties on syntax objects?
>>
>> Sam
>>
>> On Fri, May 15, 2015 at 1:53 PM Greg Hendershott
>> <greghendersh...@gmail.com> wrote:
>>>
>>> This is OT wrt deps and doc, but:
>>>
>>> I don't understand this reported test failure for rackjure, on both
>>> versions of Racket:
>>>
>>> test.rkt: raco test: non-empty stderr:
>>> #"--------------------\nFAILURE\nname:       check-exn\nlocation:
>>>
>>> (#<path:/home/racket/build-pkgs/user/.racket/6.1.1/pkgs/rackjure/rackjure/test.rkt>
>>> 68 2 2223 186)\nexpression: (check-exn exn:fail:syntax? (thunk (eval
>>> (syntax (module m rackjure (0 1 ...
>>>
>>> When I run the tests locally or on Travis CI, with `raco test -x .`,
>>> all pass including this.
>>>
>>> The message seems to be complaining that stderr is non-blank. But the
>>> test is check-exn. Is this an issue with the test environment not
>>> handling check-exn (a successful check-exn will write to stderr)?
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Racket Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to racket-users+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to