Mark this one as Solved.
I want to thank you all for pushing me to persist and for providing me with
some information to help solve the problems.
What helped was showing me to use the timeout. Once that happened the errors
happened in a timely manner. And then I had to discover a few places whe
Decided to use AoC as an opportunity to learn Nim. My solutions are in this
repo:
[https://github.com/anonanonymous/Advent_of_Code](https://github.com/anonanonymous/Advent_of_Code)
Ok, After much RTFM and going through the JSON modules source code I'm going to
answer my own question, please correct me on anything I have misunderstood:
It looks to me like the argument to the JSON constructor '%*' is not actually a
data type in the proper sense. It's an expression which is p
Hi, I'm very new to Nim, so sorry if this is a noob question.
Firstly, I'd like to thank the Nim developers, Nim really is a fantastic
system. I discovered it after trying Golang and finding it produced a 6MB
binary for a simple http client application. The application is designed for an
OpenWr
Hello,
I am trying to cross-compile to Windows using the MinGW toolchain. Here's what
I'm doing:
$ nim c -d:mingw --cpu:amd64 src/uitest.nim
Run
However, a regular Linux executable is produced. How can I compile an exe file
for Windows?
Also note the conceptual difference:
`for x in someIterable: foo(x)` deals with the _elements_ of someIterable, e.g.
with the letters of a string.
`for i in 0 ..> something.len: foo(i)` is conceptionally quite different albeit
well known from most older languages and deals with the _indices_.
By the way, if you are trying to "right size" a set or table to streamline
resizing costs, you can use rightSize(number of members to support). This is
easier than trying to guess the power of two at which such a population is
supported for both initSet and initTable. rightSize uses the same for
@satoru
Note that `getHostByName` is deprecated at least on linux.
@Libman
Nim (nativesockets) _does_ provide `getAddrInfo` but as you probably saw in
your research it's all but worthless because it's a mess. Which btw. is hardly
Nim's fault but rather a consequence of IPv6 being a makeshift i
It is now
for u in i ..< words.len:
Run
So no space between .. and <. The old notation with space could give wrong
results in rare cases due to operator priority.
Apologies if this has been asked before, I am new here.
I started learning Nim yesterday, and read through the
[tutorial|[https://nim-lang.org/docs/tut1.html]](https://nim-lang.org/docs/tut1.html\]),
where it says:
> > Zero-indexed counting have two shortcuts ..< and ..^ to simplify counting
>
Global example code can be done before the type definitions like here:
[https://github.com/nim-lang/Nim/blob/72e15ff739cc73fbf6e3090756d3f9cb3d5af2fa/lib/pure/collections/tables.nim#L100](https://github.com/nim-lang/Nim/blob/72e15ff739cc73fbf6e3090756d3f9cb3d5af2fa/lib/pure/collections/tables.nim#
I have the following code:
proc dynaChange(): proc =
var rules: seq[string]
for rule in rules:
echo(rule)
return proc(rule: string) =
rules.add(rule)
when isMainModule:
let addRule = dynaChange()
addRule
if i don't end up procrastinating like previous years, my solutions will be
here
[https://github.com/SolitudeSF/adventOfCode](https://github.com/SolitudeSF/adventOfCode)
I assume my comment on Inc() is fairly noncontroversial.
Will moving the example code to the type definitions be accepted? Will moving
the procs/methods below their corresponding type definitions be accepted?
> Constructors don't even have a consistent language convention. See `newSeq`
> vs `initCountTable`
See the first two lines of the big table here:
[https://nim-lang.org/docs/nep1.html](https://nim-lang.org/docs/nep1.html)
* `init` is used to create a **value** type `T`
* `new` is used to cr
Thanks for the help, I'll fix my program if I get back to it.
I feel this issue is easy to hit, and near-impossible for me to resolve myself
by looking at the docs, without forum help.
* CountTable doesn't have a default constructor, making it trivial to
initialize an object to an invalid sta
16 matches
Mail list logo