Re: How to call runForever()?

2018-01-28 Thread monster
Unfortunately, no. All I get is what I wrote under "Result:" in the original post. I'll try changing compiler parameters, to see if I can get more info.

"U64: static[int]" as type paratmeter => "cannot generate code for: U64"

2018-01-28 Thread monster
I've been playing with the idea type that would allow quick cross-architecture convertion for serialisation. I'm geting a compile error, and I'd like to know if I'm doing anything qrong, or if this is a current limitation of the Nim compiler. type Uint8Array* {.unchecked.} [S

Re: How to call runForever()?

2018-01-28 Thread dom96
This likely has little to do with that error. Do you have any stack traces of where the crash happens? I don't have a windows machine to test this on :

Re: Best way to define proc that works on ref X, ptr X and var X

2018-01-28 Thread GULPF
You can do something like this: type P[T] = ptr T | ref T | var T proc foobar(x: P[int]) = discard

Re: How to call runForever()?

2018-01-28 Thread monster
Hmm. I added echo(".") in "doNothing()", to be sure it's not "optimized away", but it still crashes. Shouldn't "doNothing()" im my edited example count as a "pending operation"? Also, in my real code, when the error first appeared, I have something like this: proc initCluster(port

Best way to define proc that works on ref X, ptr X and var X

2018-01-28 Thread monster
If I have some object type X, and some proc that does something complex with X, and I want the proc(s) to be defined for "var X", "ptr X" and for "ref X", what is the best/cleanest way to do that, so that the "logic" is defined only once?

Re: How to call runForever()?

2018-01-28 Thread lucian
>From the manual of poll(): Waits for completion events and processes them. >Raises ValueError if there are no pending operations. The implementation >raises the error if: if p.handles.len == 0 and p.timers.len == 0 and p.callbacks.len == 0: Your example runs fine if you protect the poll call s

Re: How to call runForever()?

2018-01-28 Thread monster
Interesting! Does anyone know what "No handles or timers registered in dispatcher" actually mean? That is, why is it an error? Regarding the compiler, I hadn't thought about trying different compilers to work around crashes. But unfortunately, I want to use this in UE4, and UE4 pretty much requ

Re: How to call runForever()?

2018-01-28 Thread mashingan
I tested using GCC 7.2 msys2 on Windows 10. Nim 0.17.2 When compiled with no release, it simply crashed/segfault. When compiled with release, it gave: Error: unhandled exception: No handles or timers registered in dispatcher. [ValueError]

Re: How to call runForever()?

2018-01-28 Thread nucky9
I wonder if it is a compiler issue. My understanding is that the vc compiler isn't as up to date as gcc and clang, especially for C. It might be worth trying a different compiler.