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

Generate Object getter/property macros to remove duplications #15386

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ysbaddaden
Copy link
Contributor

@ysbaddaden ysbaddaden commented Jan 28, 2025

Alternative to #15383 that inlines the macros' implementation instead of calling to external macros, but without any impact on compilation times or memory usage.

Like #15383 it avoids the repetition of the implementations across the set of class_(getter|property)[?] macros. Since we don't have "macro functions" in Crystal, the "inlining" needs an external crystal script to generate a static file with all the macros.

Implementing #14905 will only require to specialize the Generator#def_getter method for the class variant, then run the script to regenerate all the macros.

Generates the macros from an external script that will inline the actual
macro implementations, instead of using macros to generate the macros
and duplicating the actual implementation multiple times.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant