Re: when will [] ambiguous be solved?

2017-05-06 Thread mogu
sorry, my bad

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.

Fiber implementation

2016-08-30 Thread mogu
I made a fiber implementation just now ([nimfiber](https://github.com/mogud/nimfiber)). And it was almost borrow from standard lib **coro**. But I'm a noob to nim, so don't understand some APIs used in coro: proc GC_addStack(starts: pointer) {.cdecl, importc.} proc GC_removeSt

Re: Global defer statement?

2016-08-29 Thread mogu
Thanks! :)

Re: Global defer statement?

2016-08-29 Thread mogu
VOW, thanks very very much. You are my saviour!

Re: User defined operator Precedence and Associativity

2016-08-29 Thread mogu
Thanks for your answers. T.T

Global defer statement?

2016-08-29 Thread mogu
Now we use async libraries from standard must add **runForever()** in the last of the file. If there's a way to defer code excuting to the end of current module, we can hide this tail into macros. For example: defer: echo "world" echo "hello" # outputs: # hell

User defined operator Precedence and Associativity

2016-08-29 Thread mogu
In current nim's user defined operators, users must use the leader char or some special rules to specify **Precedence** and **Associativity**. This makes some operators do not like that appropriate. Can nim introduce two pragmas to specify these stuffs for convenience. Current nim with right as