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

register-type -- allow users to specify whether to generate getters/setters #1390

Open
scolsen opened this issue Feb 22, 2022 · 0 comments
Open

Comments

@scolsen
Copy link
Contributor

scolsen commented Feb 22, 2022

In some cases, registered types should have generated getters but not setters, e.g.:

struct foo {
  MyStruct data[1];
};

If you register-type foo [data MyStruct] you'll get an error during compilation, since it generates a setter for data and MyStruct[1] is not an assignable type. However, getters are still valid.

Perhaps we could permit an optional form in the registration, that, when present, restricts the generated functions:

(register-type foo [(data [getter]) MyStruct])

When omitted, we just use the default behavior and generate all the getters/setters.

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

1 participant