News for hackers. Stuff that matters.
Re:Rust vs. C++ Formatting by xigoi on Monday January 16, 2023 @06:17PM (#34406864)
Re:Rust vs. C++ Formatting by elcritch on Monday January 16, 2023 @06:36PM (#34407063)
The magic that makes Nim’s print / repr functions really neat is the `fieldPairs` iterator that works on any type. It’s a comptime function to iterate fields of a type, very handy and very simple to use. It can work on any type unlike Rust’s Debug macro which only works on types you own and can annotate.

https://nim-lang.org/docs/iterators.html#fieldPairs.i%2CS%2C...