Re: Help with template!

2019-03-11 Thread slangmgh
Try add the following code: template routes(body: untyped): untyped {.dirty.}= block routes: body Run

Re: Run all failed tests?

2019-03-11 Thread revilotom
Yeah it was a stupid question. Now that I think about it its more of a IDE feature not a tester feature. Sorry for wasting your time.

Help with template!

2019-03-11 Thread mrhdias
This code works as expected. But I wanted to replace the "block routes:" with "routes:" only. Any idea how to do this? import asynchttpserver, asyncdispatch template via*(rule_path: string, reqMethods: seq[string], code_to_execute: untyped): untyped = if $req.reqMetho

Re: What is the best way to run a nim program as daemon?

2019-03-11 Thread treeform
I wrote this nim program to elevate other programs to daemon status (and restart them if they crash): [https://github.com/treeform/guardmons/blob/master/daemon.nim](https://github.com/treeform/guardmons/blob/master/daemon.nim)

Re: Documentation in PDF (for no programmer)

2019-03-11 Thread drifter
Wow, great-write up!

Re: Immutability -- more ideas

2019-03-11 Thread gemath
> How do we know that harmful must not compile but that harmless should compile? If the compiler would keep tabs of which scope a symbol was bound in, it could pass this "birth scope" info on through returns and potential assignments like the one in `select`. Wouldn't write tracking detect these

Re: What is the best way to run a nim program as daemon?

2019-03-11 Thread mashingan
handle with [setControlCHook](https://nim-lang.org/docs/system.html#setControlCHook%2Cproc%29) proc

Re: What is the best way to run a nim program as daemon?

2019-03-11 Thread mrhdias
Thank you all for the suggestions. Just one more question: How do I catch a "KILL" or "HUP" or user abort signal (CTRL-C)?

Re: What is the best way to run a nim program as daemon?

2019-03-11 Thread federico3
There are different init system and tools to run an application as a daemon without having to increase your application's complexity. Currently a lot of distributions ship systemd by default as it provides features like automated health check and restart and security sandboxing. I wrote a littl

Re: What is the best way to run a nim program as daemon?

2019-03-11 Thread mashingan
I usually make the executable as service using [this reference](https://gist.github.com/bcap/5397674)