d - How do I prevent a function from being imported from my module? -
i'm looking private
attribute working not class members, module entities. functions, classes, enumerators etc.
for instance, in erlang there export attribute, goes this: -export([fun1, fun2])
, meaning fun1
, fun2
of functions in module exported. in d seems exported default, ok, there way prevent specific that?
in module being imported, can mark private keep being accessible other modules. private works same way on module level entities on class members - inaccessible outside module, usable inside module. however, still visible, can create silly errors "private function foo module conflicts function foo module b", forcing disambiguate name. (i, , several others, hoping changed @ point, since shouldn't problem!)
in module doing importing, can't "import except", can import list of specific names without importing others:
import std.stdio : file, writefln; void main() { file f; // cool writefln("hello"); // cool writeln("hey"); // "error: 'writeln' not defined" - selective import didn't pull name @ }
Comments
Post a Comment