Hacker News new | past | comments | ask | show | jobs | submit login

It is a lot safer than `from pkgfoo import *` because you get a warning if there is a collision.

    $ julia --banner=no
    julia> module A
        export foo
        foo(x) = x
        end
    Main.A

    julia> module B
        export foo
        foo(x) = x + 1
        end
    Main.B

    julia> using .A

    julia> foo(1)
    1

    julia> using .B
    WARNING: using B.foo in module Main conflicts with an existing identifier.

    julia> foo(1)
    1

    julia> B.foo(1)
    2



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: