Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DrRacket REPL is broken #4

Open
dented42 opened this issue Mar 20, 2019 · 1 comment
Open

DrRacket REPL is broken #4

dented42 opened this issue Mar 20, 2019 · 1 comment

Comments

@dented42
Copy link

When running a hyper-literate module in DrRacket, none of the identifiers bound in the module seem to exist in the REPL.

@SuzanneSoy
Copy link
Owner

This is because an extra scope is added on the whole body of the module.

https://github.com/jsmaniac/hyper-literate/blob/ae57a0d043fe3030b0c673e85de2641a2b235bee/private/common.rkt#L176

As a quick fix, you can replace #,(meta-language-nesting #'expanded-body) with #,(values #'expanded-body) in your copy of the file (in ~/.racket/YOUR_VERSION/pkgs/hyper-literate/private/common.rkt).

I'll push a fix soon which disables that scope with an option. Unfortunately, I cannot remove it without a second thought, because that would likely be a breaking change, and I have no way to test for regressions.


TL;DR: hyper-literate is a hack, and contains quite a few bugs that cannot be avoided due to Racket's module, scope and expansion systems.

Racket's notions of scopes, modules, submodules and expansion are fairly broken. Hyper-literate splits the document into two parts (the chunks put in the right order, and the prose rendered with scribble), and injects a require for the language that you specified (e.g. typed/racket).

There is no clean way to do this without breaking things with the chunk part or with the doc part. For example, you'll notice that DrRacket does not draw arrows for scribble identifiers (e.g. bold) and there's no way that I could find to fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants