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.
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
> 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
> 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),
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
Ok, we can extract with overloading - put we still can't put a constraint on
types.
> 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
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.
Uh? I just proposed a solution that implements HLists. Is there anything
missing?
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
*
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
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?)
@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
@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
@trtt please, write your example in another language where the type system
accepts it: this way we can more easily show the same
> 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,
16 matches
Mail list logo