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

Reply via email to