racket / scribble

Other
201 stars 93 forks source link

Getting error “module: identifier already required in doc” when importing code #201

Closed cmdoffing closed 5 years ago

cmdoffing commented 5 years ago

0

In my Racket program, I get the error message: "module: identifier already required in doc" when I try to require code from a file that I've written. But when I copy and paste the code into the requiring module, it works fine. Ideas?

I've tried using (provide (all-defined-out)) as well as listing all of the functions names in the provide form. By the way, I'm coding this in Scribble files rather than straight Racket files.

@(require racket/date
          racket/file
          racket/string
          racket/list
          racket/function
          racket/format
          db
          "directories.scrbl"
          "model-files.scrbl"
          )

Note that all the imports work fine from the directories.scrbl file, but the problem happens when I require model-files.scrbl.

Update: It's definitely a problem with Scribble. I changed all the code to Racket code from Scribble and the problem disappeared.

cmdoffing commented 5 years ago

I got an excellent answer on SO.

https://stackoverflow.com/questions/55441302/getting-error-module-identifier-already-required-in-doc-when-importing-code/55445918#55445918

IMHO, this is a design issue that you might want to address.

samth commented 5 years ago

Unfortunately, backwards compatibility means that we can't remove the doc export from scribble/manual. The more modern way to do this would use a doc submodule, which would avoid this problem.

cmdoffing commented 5 years ago

Thanks for responding. I'm just going to go old school and use line comments at this point. I might revisit Scribble later.

Mike Doffing

On Mon, Apr 1, 2019 at 10:50 AM Sam Tobin-Hochstadt < notifications@github.com> wrote:

Unfortunately, backwards compatibility means that we can't remove the doc export from scribble/manual. The more modern way to do this would use a doc submodule, which would avoid this problem.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/racket/scribble/issues/201#issuecomment-478611269, or mute the thread https://github.com/notifications/unsubscribe-auth/Apbj19S1_jH2qximdursmLo1e6zHH-uNks5vchywgaJpZM4cUlWo .