constructor icon indicating copy to clipboard operation
constructor copied to clipboard

Nim macros to aid in object construction including event programming, and constructors.

Results 3 constructor issues
Sort by recently updated
recently updated
newest added

Attempting to use defaults with generic objects results in compiler errors both with `{}` and `{defTypeConstr}`. We likely need to lift the generic parameters and add them to the procedures....

Trying to solve #13. Here's an example proving that it should work: ```nim import std/[macros, genasts] macro doIt(impl: untyped): untyped = result = impl result[^1] = genast(): type Bleh[T] =...

Minimal example: ```nim import constructor/defaults type User* {.defaults.} = object implDefaults(User, {DefaultFlag.defExported, DefaultFlag.defTypeConstr}) let x = init(User) echo x.repr ``` Seen behavior: ```txt /home/isofruit/dev/playground/src/playground.nim(3, 25) Error: invalid expression: User* {..}...