Skip to content

Commit 2fe14f2

Browse files
committed
Attach the value scope to forms evaluated in the REPL
In an oversight, this change wasn’t made as part of the switch to multi-namespaced Hackett, and it meant module bindings weren’t actually visible in the REPL.
1 parent cca65cf commit 2fe14f2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

hackett-lib/hackett/private/toplevel.rkt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@
8686
[(define (write-proc result port mode)
8787
(fprintf port ": ~a" (type-result-type result)))])
8888

89-
(define-syntax-parser @%top-interaction
89+
(define-simple-macro (@%top-interaction . form)
90+
#:with form* (value-namespace-introduce #'form)
91+
(@%top-interaction* . form*))
92+
93+
(define-syntax-parser @%top-interaction*
9094
[(_ . (#:type ~! expr:expr))
9195
(match-let-values ([(_ τ_e) (τ⇒! #'expr)])
9296
#`(type-result '#,(τ->string (apply-current-subst τ_e))))]
@@ -100,7 +104,7 @@
100104
this-syntax]
101105
[(begin form ... form*)
102106
(syntax/loc this-syntax
103-
(begin form ... (@%top-interaction . form*)))]
107+
(begin form ... (@%top-interaction* . form*)))]
104108
[expr
105109
(match-let*-values ([(e- τ_e) (τ⇒! #'expr)]
106110
[(e-/show) (τ⇐! (quasisyntax/loc this-syntax

0 commit comments

Comments
 (0)