#Reflection on private decls

1 messages · Page 1 of 1 (latest)

sage pike
#

I want to create a type function fn ToLogging(T: type) type that wraps each method in its input type with a logging function. This would be more useful if I can reflect on private fields. How can I do this in status quo?

split fable
#

private fields are not a thing

sage pike
#

Sorry, I meant decls.

glossy fossil
#

you also cannot reify decls

split fable
#

yeah i dont see how youd do this in any capacity

sage pike
#

Well that sucks. I guess I should just stick to Haskell and monads :/.

#

@glossy fossil @split fable Do either of you have any idea to make this work in Zig?

#

Because the logging facilities in std are very unextensible. Can I view the stack frames and log those out?

glossy fossil
#

im not sure what that means, what is your usecase and what type of logs are you trying to get?

sage pike
#

Reflection on private decls

sage pike
bold radish
#

patching code locally is much less useful than upstreaming good changes or making alternatives that fit your use case