Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question on writing deriver for class #509

Open
Wenke-D opened this issue Jul 10, 2024 · 2 comments
Open

Question on writing deriver for class #509

Wenke-D opened this issue Jul 10, 2024 · 2 comments

Comments

@Wenke-D
Copy link

Wenke-D commented Jul 10, 2024

It appears impossible to get the attache class AST using context free transformation.

class apple = object
   ...
end [@@inspect]

in the ppxlib, Deriving.add do not have the optional arg to get class_declaration list.

Did I miss something or it is indeed impossible.

Thanks !

@Wenke-D
Copy link
Author

Wenke-D commented Jul 10, 2024

The objective is to inspect the methods and fields the class, then generate some functions outside.

@NathanReb
Copy link
Collaborator

Yes indeed it seems it's not supported. Off the top of my head I can't think of a reason why we wouldn't add support for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants