Re: Should nim runtime catch signals like SIGFPE and raise an exception by default?

2017-02-16 Thread Arrrrrrrrr
>From excpt's source code, it was written with systems without exceptions in >mind: Exception handling code. Carefully coded so that tiny programs which do >not use the heap (and nor exceptions) do not include the GC or memory >allocator. You can set a custom message however: err

Re: Should nim runtime catch signals like SIGFPE and raise an exception by default?

2017-02-15 Thread mogu
I change lib/system/excpt.nim(362) quit(1) to raise newException(SystemError, "SystemError") and the following codes works var a: int = 0 try: var b: int = 5 div a echo b except SystemError: echo "Exception: " &

Should nim runtime catch signals like SIGFPE and raise an exception by default?

2017-02-15 Thread mogu
I found lib/system/except.nim catch most signals and just print signal message then quit. Is it possible to raise an exception instead of immediately quit? This gives more choice to users I think.