Follow

for aoc day 4, i just did it today, instead of doing it right when it came out. it was kinda fun to just do it as slow as i wanted and take time to learn more about

git.sr.ht/~metasyn/aoc/tree/ma

I haven't really used nim templates that much in the past, I can't belive I can get away with this:

template assign(p: Passport, a: untyped, b: bool) =
if b:
p.a = a
else:
p.invalid = true

where `a` can function as both the symbol for the field name *and* the value 🤯

· · Web · 0 · 1 · 2
Sign in to participate in the conversation
Merveilles

Merveilles is a community project aimed at the establishment of new ways of speaking, seeing and organizing information — A culture that seeks augmentation through the arts of engineering and design. A warm welcome to any like-minded people who feel these ideals resonate with them.