On Thursday, 3 December 2015 at 21:04:00 UTC, Nordlöw wrote:
is there a generic way, perhaps through reflection, to reset (inside f) all members of `c` to their default values?
You could always copy the init back over it. For a struct: s = Struct.init;for a class... well, the code is a lot uglier and liable to break if you don't have the static type right. Maybe better off wrapping the class members in a struct and doing it that way.