lexi.lambda
2018-4-12 15:16:29

@mflatt Is it still true that the result of local-expand can include letrec-syntaxes+values when stop-ids is an empty list? If so, when could that be possible?


mflatt
2018-4-12 15:16:59

No, I don’t think that’s true.


lexi.lambda
2018-4-12 15:18:57

Okay. I’m trying to improve the local-expand docs some more; I’ll update PR #2030 when I’m done.


lexi.lambda
2018-4-12 16:04:32

@mflatt Okay, I’ve pushed some changes. If you could take a look at https://github.com/racket/racket/pull/2030 when you get a chance, I’d appreciate it.


lexi.lambda
2018-4-12 16:13:34

It sounds like the expand-to-AST use case is okay for the moment, unless we start trying build in support for users to extend the compiler itself to support their custom core forms. :)


lexi.lambda
2018-4-12 16:18:45

As for the interface, that’s a hard question. On the one hand, I really wouldn’t mind a new local-expand function with an updated interface. The way local-expand handles the stop list is already unpleasant; perhaps we can solve two problems at once by coming up with a new function (syntax-local-expand?) that gives greater control over the stop list and allows configuring which core forms may appear in the output? On the other hand, if local-expand raises an exception when it produces syntax containing custom core forms, then all forms would need to be updated to support subexpressions with custom core forms, including syntax-parameterize. I guess syntax-local-expand-expression could probably uncontroversially support custom core forms, since it produces an opaque result anyway, but I don’t know how much would break if local-expand produced something someone didn’t expect.


lexi.lambda
2018-4-12 16:20:20

In the meantime, though, I’m not actually sure what workaround I should use for Hackett. Calling syntax-local-get-shadower myself seems almost certainly like the wrong thing to do, given how much everyone seems to want to get rid of it, so maybe I’ll just unhygienically introduce #%app for now instead of using a syntax parameter to adjust it.


me1356
2018-4-12 16:42:00

@me1356 has joined the channel


abmclin
2018-4-12 17:56:33

I saw a behavior with nested modules I don’t understand why it’s occurring. I have a simple example:


abmclin
2018-4-12 17:56:53

abmclin
2018-4-12 17:58:05

in (module* A racket ...) the a identifier is available because it’s been provided in the enclosing module and required via (submod "..")


notjack
2018-4-12 17:58:38

oh that is neat


abmclin
2018-4-12 17:58:49

but in the (module C racket ...) nested within (module+ B ..) the b identifier is available even though it’s not been provided by the top-most module?


notjack
2018-4-12 17:59:14

Does that behavior occur with the Racket7 expander?


abmclin
2018-4-12 17:59:15

if I take out the (submod ".." ".."), then I get a weird namespace mismatch error


abmclin
2018-4-12 17:59:26

umm am running Racket 6.12


mflatt
2018-4-12 17:59:30

@abmclin That appears to be a bug with the old expander; racket7 reports the right error


abmclin
2018-4-12 18:00:09

ok so the (module+B (module C racket...)) is actually illegal?


mflatt
2018-4-12 18:00:30

The use of b is illegal, unless you add it to provide


abmclin
2018-4-12 18:00:41

shoot, I was taking advantage of that behavior to make possible some nice test cases


abmclin
2018-4-12 18:01:06

then once I started thinking on why it worked, I realized it made no sense, so I’ll make sure not to depend on that behavior


abmclin
2018-4-12 18:14:30

@mflatt for my clarification, the old expander being used by Racket 6.12 is still a set-of-scopes expander? The “old” is meant to imply it’s a C implementation?


mflatt
2018-4-12 18:15:16

Yes. (I keep forgetting that the “old” expander was the “new” expander fairly recently.)


lexi.lambda
2018-4-12 18:16:36

@mflatt Is there a way to make the expander print the information given to log-expand to stderr, or is the only way to obtain that information to use the mysterious expand observer API?


notjack
2018-4-12 18:17:05

what’s log-expand?


mflatt
2018-4-12 18:17:29

The internal log-expand form sends information only to the expand observer.


mflatt
2018-4-12 18:18:03

We should rename that to something that doesn’t say “log”


lexi.lambda
2018-4-12 18:18:06

Alright, thanks. Is it documented anywhere how that works, or should I just read the macro-debugger source?


mflatt
2018-4-12 18:19:22

It’s not documented. You could set the parameter to a function that takes any number of arguments, and that would probably tell you as much as trying to read the macro-debugger source


lexi.lambda
2018-4-12 18:19:50

Okay, that makes sense, thank you.


lexi.lambda
2018-4-12 18:20:14

I have a program that is making the expander diverge, and I don’t understand why, so I’m trying to gain some insight into what’s happening.


pocmatos
2018-4-12 19:01:28

Is it possible in Racket to get rest keyword arguments somehow? It seems not at first try.


abmclin
2018-4-12 19:05:30

not sure if I understood you correctly, don’t think there’s a such thing as a rest keyword.


notjack
2018-4-12 19:05:45

@pocmatos the low level interface is make-keyword-procedure


notjack
2018-4-12 19:06:09

I have a package called arguments that makes it easier: http://docs.racket-lang.org/arguments/index.html?q=arguments


pocmatos
2018-4-12 19:07:30

Perfect, thanks.


notjack
2018-4-12 19:07:45

example: > (define/arguments (keywords-product args) (for/product ([(k v) (in-hash (arguments-keyword args))]) v)) > (keywords-product #:foo 2 #:bar 3) 6 > (keywords-product 'ignored #:baz 6 #:blah 4) 24


lexi.lambda
2018-4-12 19:51:55

@mflatt I have a very strange program that diverges on the Racket 7 expander but not Racket 6.12, but I’m having a lot of trouble coming up with a minimal reproduction (the real use case is a fairly complex program). I’ll keep trying, but looking at the information from the expand observer, it gets stuck in an infinite resolve, tag loop in which it introduces #%app over and over again, generating expressions that look like (#%app #%app3 #%app #%app3 #%app #%app3 #%app #%app3 ....). Do you have any idea why that might happen?


erik.hollembeak
2018-4-13 06:53:55

@erik.hollembeak has joined the channel