greg
2018-5-24 15:17:17

https://racket.slack.com/archives/C06V96CKX/p1527090366000047 I didn’t know about that either.

The docs say: > (contract-exercise val …+) → void? > val : any/c And I thought it’s weird you can’t specify “fuel” i.e. attempts.

I go to the source and it is: (define (contract-exercise #:fuel [fuel 10] v1 . vs) ... So I guess the docs just need to be updated — unless this is intended to be undocumented?


abmclin
2018-5-24 18:57:38

is it possible to dynamic-require a submodule? I tried to use submod in a dynamic-require expression and am getting a misuse of submod due to not being within a require or provide error. The documentation led me to believe it would be possible since a submod expression is a valid module-path entity according to require’s grammar and dynamic-require’s documented interface.


samth
2018-5-24 18:58:33

@abmclin sounds like you’re missing a quote


abmclin
2018-5-24 18:59:07

ok, let me see where I need to put in quote


lexi.lambda
2018-5-24 18:59:32

To clarify Sam’s point, you want something like (dynamic-require '(submod a b) 'x).


abmclin
2018-5-24 19:00:02

ok that worked, thanks!


lexi.lambda
2018-5-24 19:00:07

dynamic-require is a function, not a macro, so writing (submod a b) as a bare argument will try to apply submod as a function.


abmclin
2018-5-24 19:00:17

ahh I see, that is clear now


samth
2018-5-24 19:00:34

@lexi.lambda btw thanks for helping track down release regressions


samth
2018-5-24 19:00:52

feel free to just edit the main issue descriptions


lexi.lambda
2018-5-24 19:02:13

Okay, I will. I was mostly just curious about the rackjure test failure, which seemed like low-hanging fruit to diagnose.


samth
2018-5-24 19:08:17

not saying you have to do more (though it’s certainly helpful), just that if you do you can just edit directly


lexi.lambda
2018-5-24 19:10:18

Understood! I was about to do so and just noticed you already had.


abmclin
2018-5-24 19:42:59

do you feel the dynamic-require documentation would benefit from adding clarifying notes about its behavior as a function as opposed to syntax? My intuition about its behavior was informed by require and provide being syntax so I tripped right over dynamic-require’s subtle difference. Also @lexi.lambda’s clarification was what allowed me to finally understand the reason for double quote used for module’s identifier in the documentation’s examples, e.g.

> (module a racket/base (displayln "hello")) > (dynamic-require ''a #f)

The reason (please correct me if I’m wrong!) is because dynamic-require being a function evaluates its arguments, so 'a is not enough since it results in a which isn’t a valid module path. So instead passing ''a results in 'a which is a valid (quote id) module path.

I think the reasoning is obscure enough it would be helpful to add something to the effect to the docs.


abmclin
2018-5-24 19:52:09

I’d be happy to submit a P.R. if you’re fine with adding notes


samth
2018-5-24 19:53:27

Yes, some additional clarification (and maybe a submod example) would be good