Re: Dynamic Types

2017-02-15 Thread Krux02
Well you cannot create types at runtime. type VariantKind = enum vkString vkInt VariantType = object case kind: VariantKind of vkString: strValue: string of vkInt: intValue: int proc getArg(typeNa

Re: Nim core developer wanted

2017-02-15 Thread dom96
Updated the first post with the deadline.

Re: Dynamic Types

2017-02-15 Thread andrea
Static types, by definition, have to be known at compile time, so there is not much you can do for that. What you **can** do is mimic what dynamic languages do and write a wrapper type using [object variants](https://nim-lang.org/docs/manual.html#types-object-variants). You can see an example

Re: Dynamic Types

2017-02-15 Thread mashingan
Is [typeinfo](https://nim-lang.org/docs/typeinfo.html) lib that you need?

Dynamic Types

2017-02-15 Thread geekboy
I am a novice in nim and don't know much about the type system. I went through the documentation and found this out > All expressions have a type which is known at compile time. Nim is statically > typed. Is there any way I can create typed variables at runtime? Here is what I am trying to ach

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.

Re: FFI to C, what is the equivalent to const u8 *

2017-02-15 Thread lucian
1. C lang: passing (void *) as an parameter (typed *) seems legit for the gcc compiler (apparently not so for g++) 2. the Nim to C backend _might_ actually consider the type of the message variable and create the proper/compatible parameter for the C call both work in your favor and this s