Re: Any photos or videos from NIM @FOSDEM ?

2018-02-05 Thread dom96
Check out our Twitter: [https://twitter.com/nim_lang](https://twitter.com/nim_lang)

Any photos or videos from NIM @FOSDEM ?

2018-02-05 Thread alfrednewman
(NT)

Re: Base Class Methods

2018-02-05 Thread Arrrrrrrrr
You are right, i forgot to add the type casting. The less verbose version is to define a base proc and put there any common code for toolMethod: type A = ref object of RootRef i: int B = ref object of A c: char proc baseTest(a: A) = a.i =

Re: A few issues

2018-02-05 Thread donallen
@Araq 1. Thank you. 2. You're right. My aging eyes did not see the ':'. 3. See the Tutorial: [https://nim-lang.org/docs/tut1.html#basic-types](https://nim-lang.org/docs/tut1.html#basic-types) . 'String' is among them.

Re: asyncdispatch and "closing server socket"

2018-02-05 Thread monster
@Araq I think my example didn't clearly show that the issue was that the decision to close the server socket happens "independently" from the code that accepts incoming connections. I've now move the "close code" in the same proc as the "open code" (as you suggested), and use regular polling on

Re: asyncdispatch and "closing server socket"

2018-02-05 Thread Araq
In your snippet you don't have to split up this in 2 different procs. And even if you do, you can pass `server` as a parameter. > And, more generally, does that mean I still need to use shared-heap to pass > messages/signals across async tasks? I think you can also use (async) queues instead.

Re: A few issues

2018-02-05 Thread cdome
Useful trick 1\. open main module doc: [https://nim-lang.org/docs/system.html](https://nim-lang.org/docs/system.html) 2\. Do "group by type" 3\. Find cstring type You will learn most of the stuff cstring can do

Re: Very impressed so far

2018-02-05 Thread Arrrrrrrrr
Welcome to nim-land. Go and Rust are common stops for new users as far as I read.

Re: Base Class Methods

2018-02-05 Thread Arrrrrrrrr
You can use [procCall](https://nim-lang.org/docs/system.html#procCall,untyped): procCall toolMethod(gun, 5) Bear in mind nim is not as OOP friendly as other popular languages such as Java/C#. Here you are not expected to use inheritance for everything. By the way:

Re: Moving

2018-02-05 Thread Araq
var myPendingRequests {.threadvar.}: HashSet[ptr MsgBase] myPendingRequests.init() The compiler made you write this, it disallows `var myPendingRequests {.threadvar.} = initSet[ptr MsgBase]()`. Ever wondered why? Because it would only run for the main thread. I improved its error

Re: Moving

2018-02-05 Thread Araq
> If the error goes away, then that will "prove" the HashSet (and presumably > every other complex threadvar object) needs to be initialised explicitly in > each thread. If that is the case, it would be nice to have some syntax > (something like the opposite of "static:") that takes care of

Re: Base Class Methods

2018-02-05 Thread Araq
Use `method` instead of `proc`? Not sure I understand your question.

Re: A few issues

2018-02-05 Thread Araq
1. [https://github.com/nim-lang/nim/issues](https://github.com/nim-lang/nim/issues) 2. No, it doesn't, it shows the correct syntax `-d:release`. 3. Fair enough, but I doubt `string` is a "basic type".

Re: Can't send email via port 587 with TLS

2018-02-05 Thread echo
When you use SSL, you need to specify this parameter when compiling: nim c -d:SSL xx.nim

Re: Is there any Textadept user here ?

2018-02-05 Thread DTxplorer
My version is 9.6. ui.set_theme() is the good function for me (and not set_theme()), so it seems "ui" is also a buffer. The concept of buffer remains mysterious for me, but Textadept is usable now.