[racket] current-module-name-resolver and syntax/docprovide

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Jun 6 01:43:54 EDT 2014

At Thu, 5 Jun 2014 16:15:26 -0400, Greg Hendershott wrote:
> After stumbling across the syntax/docprovide module [...]
> 
> To back up a step: Is syntax/docprovide something that is intended to
> be used these days?

No. It was a very early experiment. Like so many early Racket
experiments, it was used for something significant, and so it never
went away, but you don't want to use it for new things.

I'll add a note to the documentation.

> As I'm not 100% crisp on the module name resolver protocol, I'm not
> sure where the correct fix is.
> 
> - Is there some 3-arg variant of c-m-n-r that needs to be documented?
>
> - Should I "defensively" add a 3-arg variant, and chain to the
> original? That would avoid an abend. But (say) I'm checking in the
> 2-arg case to do something special. If I get 3 args, I don't know if
> it's supposed to be like the 2-arg or 4-arg case... much less which
> args mean what.

I'm pretty sure that my intent was to phase out the 3-argument variant
when I added the 4-argument variant (long ago). I left the default
module name resolver accepting 3 arguments as a transition ---
defaulting a 4th to `#t` --- and never took that out.

I don't want to require a resovler to accept 3 arguments, but changing
the default resolver might break other things. I'm inclined to note in
the documentation that the default resolver accepts 3 arguments,
although it's only meant to be called with 4. I think you should leave
your resolver as-is, accepting 2 or 4 arguments.

> - Should syntax/docprovide.rkt be changed to the 2 or 4 arg variant?

Yes.


Posted on the users mailing list.