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:
*
> 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
> 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
> 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
It seems to be valid Nim code. It's also a design right from the 90ies, slow,
impossible to parallelize, hard to serialize.
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
Try to add gcsafe pragma to your proc
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