sorawee
2020-3-26 10:15:46

@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.


sorawee
2020-3-26 10:18:01

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


sorawee
2020-3-26 10:18:29

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


sorawee
2020-3-26 10:20:16

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


sorawee
2020-3-26 10:20:27

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


soegaard2
2020-3-26 10:20:46

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


sorawee
2020-3-26 10:22:17

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


soegaard2
2020-3-26 10:22:40

Not sure at all.


greg
2020-3-26 15:05:04

@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?


sorawee
2020-3-26 15:07:24

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”.


greg
2020-3-26 15:08:43

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


greg
2020-3-26 15:09:19

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


sorawee
2020-3-26 15:09:59

Thanks. Will try it out.


n.gimenez66
2020-3-26 15:30:43

@n.gimenez66 has joined the channel


greg
2020-3-26 18:35:52

What is an example of that happening?


greg
2020-3-26 18:36:31

I haven’t experienced that.


greg
2020-3-26 18:36:52

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


greg
2020-3-26 18:37:42

@sorawee ^


sorawee
2020-3-26 18:39:11

Try all-defined-out


sorawee
2020-3-26 18:39:15

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


sorawee
2020-3-26 18:41:25

sorawee
2020-3-26 18:51:38

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