Skip to content

In the debugger, if blocks DO introduce new scope.  #67

Open
@mikewojnowicz

Description

@mikewojnowicz

According to the Julia performance manual, if blocks and begin blocks do not introduce new scope. However, the Debug package alters this fact.

When running testfunction() outside the debugger, the object "value" exists for both iterations of k=1:2.
However, when running testfunction() inside the debugger, the object "value" only exists for the first iteration. Then, on the second iteration, we get: ERROR: value not defined.

I realize the fix is quite simple, but for whatever it's worth, I found this aspect of the debugger to be quite confusing to me as a new Julian (coming from R and MATLAB).

using Debug

@debug function testfunction()
for k=1:2
if k==1
value=k
end
println(value)
end
end

testfunction()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions