Overflow Checks
Nim's unsigned ints do not model integers. They model integers modulo 2^width. As such, the results are accurate.
Array concatenation
Makes one wonder why `toSeq` is called `toSeq` and not ``@``...
Nim v2: what would you change?
Would allowing `div` to be used in both contexts * `10 div 3` * `div: text "karax"` create an ambiguity?
Splat operator implementation with macros
Is it not possible with some term rewriting macros?
Advent of Nim 2022
Hmm, I feel like compared to last year, not many people are posting their Nim solutions to the megathread.
Advent of Nim 2022
I'm doing AoC in Nim again: <https://github.com/MichalMarsalek/Advent-of-code/tree/master/2022/Nim>
convert HSlice to varargs?
I don't remember if seq can be used in place of varargs. If so, toSeq should work.
Advent of Nim 2021
I guess I'll put my repo here too: <https://github.com/MichalMarsalek/Advent-of-code/tree/master/2021/Nim>
system.set
Dammit, I planned to mention I know both hashsets and intsets, this question is not about that.
system.set
Hello, I am missing two features in the system.set type. 1\. Support for larger ranges. set[uint32] would be huge, but I think that set[int24] (where type int24 = range[0..<2^24]) would be reasonable (2MB)? 2\. func empty(s: set[T]): bool = > s.card == 0 But implemented more efficiently (you don't need to know the exact cardinality just to check if a set is empty, you can exit looping through the bitvector as soon as you find a word with nonzero popcount, right?). I'd like to see other functions like func intersects(a, b: set[T]): bool = not empty(a*b) Again implemented more efficiently than that.