As the author of constructor I really have to agree with the "Oh god it's so tedious to right it so many times" so I solved it. Recently just made my new `defaults` macro which makes it so you only have to type the definition once! Feast your eyes on macro magic! import constructor/defaults type Thingy {.defaults.} = object # Tests the basic operation a: float = 100 b: string = "Hello world" implDefaults(Thingy) assert initThingy() == Thingy(a: 100f, b: "Hello world") Run
- Initializing objects from proc parameters Stefan_Salewski
- Initializing objects from proc parameters DavidKunz
- Initializing objects from proc parameters Yardanico
- Initializing objects from proc parameters alexeypetrushin
- Initializing objects from proc parameters Araq
- Initializing objects from proc param... ElegantBeef
- Initializing objects from proc p... treeform
- Initializing objects from pr... Stefan_Salewski
- Initializing objects from pr... ElegantBeef