Advent of Nim 2022

2022-12-20 Thread bg
You may already be aware of this, but if you don't want to use symbols, you can make a `max=` proc in nim: proc `max=`*(a: var int, b: int) = a = max(a,b) var x = 5 let y = 7 x.max= y assert x == 7 Run

Advent of Nim 2022

2022-12-02 Thread bg
It is really clever! Nim is so flexible that the input can be interpreted as valid Nim code and run! That said, I don't prefer that approach in my own solutions. When I clean up my solutions I tend to want to make them run faster, and for those purposes I consider baking the input into the exec

Advent of Nim 2022

2022-11-30 Thread bg
I'm in a similar situation as some others: I probably won't have time to do all the days as they come. I plan to share my answers here:

Can I haz splat operator

2022-01-11 Thread bg
It's not hard to roll your own (which I know many have done). eg:

Advent of Nim 2021

2021-12-02 Thread bg
Hi all! Sharing my repo too: