
Aaaah, found the -M switch. Found even the -h switch that now seems stupid I didn’t think about it yesterday. Probably that should be in the tutorial.

that reminds me, @ben any update on my PR (https://github.com/racket/slideshow/pull/11)

It still looks good to me, lets merge it

do you want to squash any of the commits?

Is there any good way to learn about the mechanics of for-label
or the label phase in general? Namely, I’m wondering what scribble actually gets out of using the macro expander to build hyperlinks.

(As opposed to just using the bindings at, say, phase 0.)

Does anyone jot down their thoughts in a Jupyter-like notebook solution?

@leif I think scribble’s use of the label phase was because submodules didn’t exist yet, and if they did scribble would have used them instead

@notjack That was @michael.ballantyne and I first thought. But there seems to be some major differences here.

Like, 1. phases allow for an interleaved execution that submodules just don’t.

And 2. It seems like the label phase is the only way in Racket to declare a module (and possibly visit it) while getting the bindings statically without instantiating it.

Also, this combination of features confuses me: https://gist.github.com/LeifAndersen/0fe797a827db037a39a5574d1e90ada9


Like, why on earth does begin-for-syntax blocks get top-level like semantics. :disappointed:

(Thanks to @michael.ballantyne for finding it.)

@leif While a begin-for-syntax
form is being expanded at phase N, there will be no expansion of forms at level N–1, so there’s no need to run code at phase N; it can be compiled as a group. As soon as you go back to expanding at level N–1 after a begin-for-syntax
, expansion may involve macros that run at phase N, so the begin-for-syntax
ed code needs to have been run. That explains why the use of g
in the last example can’t be a macro use. At the time time, you’d really like for mutually recursive define-for-syntax
ed functions to work, and that’s why the second example compiles: the expanded/run begin-for-syntax
assumes that not-yet-bound identifiers refer to values.

It’s true that for-label
imports binding without setting up an invocation/visit dependency. I don’t know whether submodules could achieve the same goal, but I think probably an extra ingredient of some sort is needed – and for-label
(which I think of as phase +∞) might be as simple as any other extra ingredient.

@wander4096 has joined the channel

@mflatt That makes sense, thanks.

ping @apg do you mind if I squash & merge, or do you want to keep the commits separate?

Whatever you typically do is totally fine by me.