source-academy/js-slang

Inner Scope Access issues in REPL programs when using explicit control variants

Closed this issue · 0 comments

The following code snippets added into the REPL line by line when using explicit control will behave unexpectedly.

// using js-slang
(a => 1)(7);

a; // will access 7 even though a is in an inner scope
// using js-slang
{ const b = 1; }

b; // will access 1 even though b is in an inner scope
;; using scm-slang
(define a 1)

((lambda (a) a) '(1 2 3))

a ;; will access the value of list (1 2 3) and not 1