
@mflatt what’s the point of, say, all-defined
subform in #%provide
? I tried (provide (all-defined-out))
and it seems to be able to identify all defined identifiers, so it looks like the grammar for #%provide
’s subform could be simplified and normalized further more.

(Or at least, the grammar of the fully-expanded #%provide
’s subform could be simplified further more)

Note that if I use (#%provide (all-defined))
directly, then currently it doesn’t expand further to identify all defined identifiers.

Another related question: is there a foolproof way to identify all exported identifiers in a module? I was hoping that looking at fully expanded code will be enough, and it generally is except the (#%provide (all-defined))
cases I mentioned above

I really hope I don’t need to look into the linklet level…

Compatibility with old code? At some point there were no in and out suffixes.

That’s a disappointing (but understandable) answer :disappointed:

Not sure at all.

@sorawee Can you use module->exports
? Its docs imply the module must only be declared (not necessarily instantiated or visited), so I think it would work in e.g. the same current-namespace
in which you fully expand
-ed the code? I think?

Ah, nice. I will try that. By the way, this is me trying to find a way to make racket-xp-mode
not crossing exported identifiers as “unused”.

I think one easy way to get such a namespace for a module is to require it for-label
. I think I saw this in https://github.com/rmculpepper/racket-whereis

But if you’re looking at making a change to drracket/check-syntax
you already have such a namespace.

Thanks. Will try it out.

@n.gimenez66 has joined the channel

What is an example of that happening?

I haven’t experienced that.

A simple example: #lang racket/base
(define (foo x) x)
(provide foo)
foo
is not shown as “unused”.

@sorawee ^

Try all-defined-out

#lang racket/base
(provide (all-defined-out))
(define abcdef 1)


Thanks for the racket-xp-mode
by the way. It is really really great.