On Fri, Nov 4, 2016 at 12:30 PM, Simon Byrne <[email protected]> wrote:
> How can I reexport a variable defined in the  __init__ method of a
> submodule, to play nice with precompilation.
>
> The following gives me a "WARNING: could not import Foo.bar into
> TestExport":
>
> __precompile__()
> module TestExport
>     export bar
>
>     module Foo
>         export bar
>
>         function __init__()
>             global const bar = 1

Don't do this. This isn't really precompile compatible.
If it is a runtime value,use something like a global const `Ref{Int}`
and mutate that in the `__init__` function instead.

>         end
>     end
>
>     import .Foo.bar
> end # module
>
> it works if I replace "import .Foo.bar" with "using .Foo", but I don't want
> to import all the submodules exported symbols into the module.
>
> Any ideas?
>
> -Simon
>

Reply via email to