New scope solution

IIUC, these two examples would behave differently:

julia> found = false
false

julia> for x in 1:5
            if x == 5
                found = true
                break
            end
        end

julia> found
false
julia> found = false
false

julia> for x in 1:5
            if !found && x == 5
                found = true
                break
            end
        end

julia> found
true

If so, it seems like a rather subtle thing to keep track of.

2 Likes