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

Improve support for debug traps in global scope #2

Open
toivoh opened this issue Aug 16, 2012 · 2 comments
Open

Improve support for debug traps in global scope #2

toivoh opened this issue Aug 16, 2012 · 2 comments
Labels

Comments

@toivoh
Copy link
Owner

toivoh commented Aug 16, 2012

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?)

@toivoh toivoh closed this as completed in d39c6e4 Aug 16, 2012
@toivoh
Copy link
Owner Author

toivoh commented Aug 16, 2012

@toivoh toivoh reopened this Aug 20, 2012
@toivoh
Copy link
Owner Author

toivoh commented Aug 20, 2012

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.

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

No branches or pull requests

1 participant