Re: Testing private functions

2017-09-05 Thread cdunn2001
Just test the private parts from within its own file. That's a nice way to write some peace-of-mind tests. (Testing an implementation detail is not always a bad idea.) when isMainModule: test_private() Another example: *

Re: Introduction

2017-09-05 Thread cdunn2001
> So, after looking into new and up and coming "better C's" like Odin and Jai, > I then found Nim. I will never say anything negative about Jai (except that it's not actually available). A friend of mine watches all the Jai videos. I'm glad to see someone else recognizes brilliance. But Nim

Re: Compositional inheritance voodo

2017-09-05 Thread jacmoe
> It seems to be valid Nim code. That's what I wanted to know, thanks! > It's also a design right from the 90ies, slow, impossible to parallelize, > hard to serialize. I know. I wouldn't have come up with the design if I wrote it myself, because it is a straight port of the Python tutorial

Re: Compositional inheritance voodo

2017-09-05 Thread Jehan
> So, what I basically want to know is if what I wrote is valid and sound Nim > code. It is valid code. However: You don't actually use inheritance in your code for `Fighter` and `Thing`, so `of RootObj` and `method` (instead of `proc`) may introduce unnecessary overhead, unless you plan on

Re: Compositional inheritance voodo

2017-09-05 Thread Araq
It seems to be valid Nim code. It's also a design right from the 90ies, slow, impossible to parallelize, hard to serialize.

Re: Nim newbie request/challenge

2017-09-05 Thread jzakiya
The times I previously posted were from a VirtualBox VM, limited to 4GB of ram, and in a "noisy" environment. The times here are derived from my host OS (PCLinuxOS) with full access to the system's 16GB of ram, in a "quiet" environment, i.e. I closed everything and rebooted, then just opened a

Re: Killing an AsyncHttpServer

2017-09-05 Thread Tiberium
Try to add gcsafe pragma to your proc

Killing an AsyncHttpServer

2017-09-05 Thread def_pri_pub
So I've got some code like this: import asyncDispatch import asynchttpserver # Create the server object and state data var server = newAsyncHttpServer() let port = 8000 # ... proc handleRequest(req: Request) {.async.}= ## Handle an