Leveraging my knowledge of C, I assumed a "static" function would be hidden outside of its own source file. I can't find any statement about the semantics of a static function in the documentation, and in practice (ldc2 on Linux) it doesn't hide the function?

file tst.d:

import std.stdio : writeln;
import tst1;

void
main()
{
    writeln(do_op());
    writeln(do_op());
}


and file tst1.d:

static int
do_op()
{
    static int x;

    x += 1;
    return(x);
}

Reply via email to