While I like the consenting adults philosophy, and agree that export
choices provide a useful signal when 'using' a module, that signal
disappears when using 'import'.
As folks begin developing larger projects, 'import' will become more
important for managing namespaces. In those cases it w
And as we've already discussed "using" are ugly and in my opinion only make
sense in the REPL. But well, that's my opinion and I'm not a language designer.
Just try to "using" a module redefining "sin", you won't try twice.
I'm also waiting for the first julia big projects and users begging "wou
The way to mark things private in Julia in my experience is simply not
exporting them. They'll still be available on the Module object itself
(e.g. MyModule.bar), but by not exporting them, you're signaling that
they're private, the same way you do with an _ in Python.
On Tuesday, June 10, 2014
The convention to make things private is to not export them. When "using" a
module, which is the normal way, those non-exported modules are not visible
in the current scope. They are still accessible when using the fully
qualified path.
Am Dienstag, 10. Juni 2014 21:39:56 UTC+2 schrieb Davide L
On Tuesday, June 10, 2014 2:39:56 PM UTC-5, Davide Lasagna wrote:
>
> Thanks Patrick.
>
> Does this mean that there is no way to make things private? I thought
> that only explicitly exported symbols where accessible.
>
> Anyway then, what is the common approach in Julia to mark things as
> priv
Thanks Patrick.
Does this mean that there is no way to make things private? I thought that
only explicitly exported symbols where accessible.
Anyway then, what is the common approach in Julia to mark things as
private? Python use single and double leading underscores, but haven't seen
too muc
Which is asking for troubles...
I always thought that non exported objects could not be imported.
Use the "using" keyword instead of the "import" keyword, in conjunction
with your (correct) intuition about "export".
module MyModule
include("file.jl")
export foo
end
...
using MyModule
foo()
MyModule.bar()
On Monday, June 9, 2014 4:21:16 PM UTC-5, Davide Lasagna wrote:
>
> Hi all,
>
> I h