How to lookup the IPV6 addr of a domain name?

2018-11-30 Thread satoru
I'm using the code below to print IP addresses of a domain name. let info = getHostByName("www.kame.net") for addr in info.addrList: echo addr But it only outputs the IPV4 address.

Re: how to run vim and get output

2018-11-30 Thread curioussav
Thanks for following up to the reddit question here. I have two children under three and no brain power right or free time right now so I lose track of things often. With regards to vim, I am a daily user so I should have immediately realized it doesn't write the file to stdout rather just its

Re: Memory regions / gc:regions

2018-11-30 Thread bpr
> Well this feature is underdeveloped and so the code contains lies/stuff not > implemented. I see that the feature is not in the Nim manual any more. The manual always was aspirational, describing unimplemented features, but now I wonder, are regions no longer desired? Will destructors handle

Re: FE web libraries

2018-11-30 Thread Libman
> The Nim Forum software is a solid example of a fully functional app in Karax. I wouldn't call it "a solid example of a fully functional app" until threads can be archived (ex. [archive.org](https://web.archive.org/web/20181201000107/https://forum.nim-lang.org/t/4407),

Re: HttpClient networking problem

2018-11-30 Thread jlhouchin
Hello, My apologies that terminal session is gone. Here is what I am attempting. Here is some code that I would like to see run indefinitely. I would think that while I have it running and I turn off my network that at some point I would see an Error raised. I almost never do. My naive

Re: Heterogen lists

2018-11-30 Thread trtt
Ok, we can extract with overloading - put we still can't put a constraint on types.

Re: Heterogen lists

2018-11-30 Thread trtt
> Uh? I just proposed a solution that implements HLists. Is there anything > missing? You really did implement it, we just can't access the generics(like in my original 2. implementation). Back to square one. > In any case, I think that in Nim a more idiomatic solutions would to use > tuples

Re: Heterogen lists

2018-11-30 Thread andrea
In any case, I think that in Nim a more idiomatic solutions would to use tuples instead, which are of course isomoprhic. One cannot used recursion with tuples, but that can be easily circumvented with macros.

Re: Heterogen lists

2018-11-30 Thread andrea
Uh? I just proposed a solution that implements HLists. Is there anything missing?

Re: Heterogen lists

2018-11-30 Thread trtt
Yes, and those lists would be typesafe too. We could implement HLists flawlessly in Nim if it'd have either of these feature groups: * pattern matching + nominal virtual abstractions("interfaces", but we only have structural ones by concepts) * pattern matching + existential types *

Re: Heterogen lists

2018-11-30 Thread andrea
Yes, since the list is heterogeneous, the type changes according to the various parameters. It is very similar to a tuple - as explained in the blog post I linked - but it behaves like a list in certain respects and this helps in writing generic procedures that would otherwise require a macro

Re: Heterogen lists

2018-11-30 Thread mashingan
Hmm, means that it will construct a new type (maybe anonymous tuple?) for each of initiations? I can't see much of advantage of it though, hmm, anyone care to elaborate? (Should I create a new thread instead?)

Re: Heterogen lists

2018-11-30 Thread andrea
@alehander42 What @trtt is trying to implement is called an HList, and is a common construction in, say, Haskell or Scala. This is an [example of implementation in

Re: Heterogen lists

2018-11-30 Thread andrea
@trtt Here it is # hlist.nim type HNil* = object HCons*[H, T] = ref object h: H t: T HList = HNil or HCons let hNil* = HNil() proc cons*[H; T: HList](hd: H; tl:T): auto = HCons[H, T](h: hd, t: tl) template

Re: Heterogen lists

2018-11-30 Thread alehander42
@trtt please, write your example in another language where the type system accepts it: this way we can more easily show the same

Re: Advent of Code 2018 megathread

2018-11-30 Thread miran
> Currently there are 18 of us who joined. Make that 38, as we speak ;) Less than 24 hours to go until the start so here are some basic tips/rules: 1\. **SPOILERS** : Try to keep this thread as spoiler-free as possible. If you can't wait to share your solution,