xrepl ,require-reloadable and ,require

37 views
Skip to first unread message

Marc Kaufmann

unread,
Oct 8, 2019, 7:32:20 AM10/8/19
to Racket Users
Hi,

according to the docs (https://docs.racket-lang.org/xrepl/index.html#%28xrepl._require-reloadable%29) I would have assumed that when I do

> ,require-reloadable "code.rkt"

that I can use whatever "code.rkt" provides, the same way as when I do

> ,require "code.rkt"

However, when I do just the ,require-reloadable I have to follow it up with a simple ,require for the provides to be available. Example: if code has (provide my-function), then I have (where ,rr is the short-form for ,require-reloadable and ,r for ,require):

> ,rr "code.rkt"               
> (my-function args)
; my-function: undefined;
...
> ,r "code.rkt"
> (my-function args)
; Works fine, and seems like I can reload it afterwards

Is this how it should be - and if so, why? Might be worth pointing out in the docs if this behavior is expected, as I kept closing and restarting the repl to reload my changes since I couldn't get ,require-reloadable to work.

Cheers,
Marc

Marc Kaufmann

unread,
Feb 21, 2020, 12:26:35 PM2/21/20
to Racket Users
Hi,

I'm hitting the same issue again, except that now that I use Typed Racket, and after I do the

> ,rr "code.rkt"
> ,r "code.rkt"

dance, if I `provide` a new function in code.rkt, then it complains that it is missing type for the identifier, and says that I should consider using `require/typed` to import it. But code.rkt is #lang typed/racket, and I don't want to specify every type again!

So

1. how can I get Typed Racket to reload a file (I started it with `racket -I typed/racket`)
2. is there a way to avoid the Step 1: > ,rr "code.rkt" Step 2: > ,r "code.rkt" dance even for standard Racket?

Or what workflow do people use to reload files quickly (that does not depend on Emacs/Racket-mode)?

Cheers,
Marc
Reply all
Reply to author
Forward
0 new messages