Re: Moving "top level" code to a proc affect initialisation of threadvar

2018-02-03 Thread Stefan_Salewski
sendMsgNow(dst, addr m) Is this really safe when m is located on the stack of proc startTest() ? I don't know, but would worry.

Moving "top level" code to a proc affect initialisation of threadvar

2018-02-03 Thread monster
In my test, I have this code: type TstMsg = Msg[int] TstRep = Msg[float] var dst: QueueID initThreadID(ThreadID(0)) var m: TstMsg m.content = 42 when USE_TOPICS: initTopicID(TopicID(33)) let pid = myProcessID() dst

Re: How to make covariance ?

2018-02-03 Thread oom
Nice it simply that ! Thanks

Re: {.global.} and generics

2018-02-03 Thread monster
Hi, I'm also using 0.17.2. Maybe I interpreted the problem incorrectly... I'll use your example to check if it behaves differently in my code.

Re: {.global.} and generics

2018-02-03 Thread Smaehtin
Your example seems to work fine with 0.17.2, idOfType is only called once per T import typetraits type Message[T] = object proc idOfType*(T: typedesc): int {.inline.} = echo("Getting Id of type ", T.name) when T is int: 0 else:

{.global.} and generics

2018-02-03 Thread monster
To make sure the messages in my message-queue are type-safe, I have to record the message type in each message. This is how I went about it: proc idOfType*(T: typedesc): MsgTypeID {.inline.} = let tid = 0 # Accesses "type register here" ... MsgTypeID(tid) proc s

Re: Is there any Textadept user here ?

2018-02-03 Thread DTxplorer
Thanks for the quick answer but I have another question. How do you know the name of the "buffer" you want to set ? The manual is not very clear about this.

[RFC] List comprehension replacement and syntax

2018-02-03 Thread bahm
Before we begin: I'm new to Nim and it's been a while since I did anything to do with AST, parsing, etc. so my suggestions may be whacky. If they are, simply say so and turn the discussion in the right direction. **Where we're at** List comprehension is currently available through the _future_

Re: try , accept finally question

2018-02-03 Thread Araq
Use `raise` to terminate the program in a way that works with `finally`. It's interesting that C++ does this correctly, we should probably do the same.

Re: Is there any Textadept user here ?

2018-02-03 Thread darek
Theme font could be set by editing ~/.textadept/init.lua >From >[https://foicica.com/textadept/manual.html#Themes](https://foicica.com/textadept/manual.html#Themes) buffer.set_theme() can also tweak theme properties like font face and font size without editing the theme file itself: buffer.set

Is there any Textadept user here ?

2018-02-03 Thread DTxplorer
Hi, I tried Textadept today I don't know where is the community so I ask here because this editor supports Nim. I read all the API and manual during hours and I didn't found how to set the default font size. Any help is welcome.