Debug.jl
Debug.jl copied to clipboard
Improve support for debug traps in global scope
Need to consider the scoping rules in global scope.
Should be as simple as suppressing AST transformation in debug_eval for global scopes?
Will have to assume that @debug is invoked at global scope. (Possibly check it?)
https://github.com/toivoh/julia-debugger/commit/ec4d4b3e00b5610cd1c55850e3ad0531ce30fb4c also helped
It seems that global scoping behavior is a bit more complex than I thought. E g, in global scope
x = 0
let
x = 1
end
print(x, " ")
let
x = 0
let
x = 1
end
print(x)
end
produces 0 1; the first let doesn't assign to the outer x since it's global, while
x = y = 0
for x = 1:4
y = 4
end
print((x,y), " ")
let
x = y = 0
for x = 1:4
y = 4
end
print((x,y))
end
produces (4,4) (4,4); the first for loop doesn't care that x and y are globals.