Re: two questions about static

2018-01-14 Thread lotzz
yeah I have noticed that too, might be a bug... I wouldn't know how to go about stating that though

Re: two questions about static

2018-01-10 Thread Udiknedormin
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:

Re: two questions about static

2018-01-10 Thread lotzz
Awesome Thank you, that worked great

Re: two questions about static

2018-01-10 Thread yglukhov
Looks like you need a compileTime var: var test {.compileTime.} = 0

Re: two questions about static

2018-01-10 Thread lotzz
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

Re: two questions about static

2018-01-10 Thread lotzz
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

Re: two questions about static

2018-01-10 Thread Araq
> 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.)

two questions about static

2018-01-10 Thread lotzz
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