yeah I have noticed that too, might be a bug... I wouldn't know how to go about
stating that though
Bizarre enough, the following seems to work:
#module A
static:
var test=0
proc test_proc(): void {.discardable,compileTime.} =
var a = test
echo a
static:
test_proc()
#module B
import A
static:
Awesome Thank you, that worked great
Looks like you need a compileTime var:
var test {.compileTime.} = 0
Here I have made an example of what is happening
#module A
static:
var test=0
proc test_proc(): void {.discardable,compileTime.} =
var a = test
echo a
#module B
import A
static:
test_proc()
this will
thanks, I think i learned I have a completely different problem then what I
thought was going on, I will try to figure it out before I bother more people
about it, but what is happening is that a proc I have made is using static
variables defined in one module, but when I export that proc and us
> is there a way to use these static variables outside of the module they are
> defined in
Sure, just give them an export marker. (The asterisk.)
So just to start, I am very new to nim I started reading about it and
programming in it 4 days ago. I understand that using static like this
static:
var some_variable = 10
evaluates the statement at compile time and uses the Nim VM to do that
my questions are, is there