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

Update variable scope section in ReadMe instructing to use a let block #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Tortar
Copy link

@Tortar Tortar commented May 11, 2024

Should superseed #61 and fix #66

both of this work with the new suggestion:

using Suppressor
g = let
        g = 1
        @suppress g += 1
        g
    end

module M
    using Suppressor
    g = let
            g = 1
            @suppress g += 1
            g
        end
end

since now

julia> g
2

julia> Main.M.g
2

@Tortar
Copy link
Author

Tortar commented May 11, 2024

Actually another possibility is to say that @supress should be used only one expression at a time with rebinding e.g.

julia> using Suppressor

julia> f = @suppress function f end; f
f (generic function with 0 methods)

julia> f
f (generic function with 0 methods)

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

Successfully merging this pull request may close these issues.

Suppressor.jl doesn't work when used in a module
1 participant