So we have two separate problems, IIUC:

1) The intermediate abstraction leaks exported fields of `TOb` into the top 
layer.

2) `mdlabst.Tcon` doesn't present the API of a matching type to the top layer.

The reason for #1 is probably that the Nim compiler doesn't evaluate generics 
like concepts into actual type classes, but just uses them as predicate filters 
for types. For a matching type like `TOb`, the definition of `Tcon` effectively 
mutates into `type Tcon* = TOb`. The "pragmatic workaround" would probably be 
"Don't export the fields, then.", which works until there is a fourth module 
which actually needs access to them...

As to #2: imagine #1 was solved, if there was a macro `makeApi(Tcon)` which 
generates exported delegate procs for the ones defined in `mdlImpl` (instead of 
the re-exports in my code), would that meet your criteria?

Reply via email to