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

PR #250 introduces a lot of duplicate code for defining reversible primitives #257

Open
tolauwae opened this issue Aug 31, 2024 · 0 comments
Assignees
Labels
refactor Refactoring of the code

Comments

@tolauwae
Copy link
Member

tolauwae commented Aug 31, 2024

The #250 PR introduces a lot of duplicate code for defining reversible primitives.

It is not trivial to refactor but should be done either way.

Relevant discussion:

This is what I have been wanting to do, but because the primitives array is a global array with a fixed size defined using a #define in the cpp file this can't be very easily done. You can't really use the #define for the size from another file using extern. You also can't make it an integer because not all c++ compilers support using variables as array size. The solution would probably be to just use an std::vector.

Originally posted by @MaartenS11 in #250 (comment)

@tolauwae tolauwae added the refactor Refactoring of the code label Aug 31, 2024
@tolauwae tolauwae changed the title The #250 PR introducing reversible primitives includes a lot of duplicate code for defining reversible primitives. Refactoring is not trivial but should be done either way. **Relevant discussion:** This is what I have been wanting to do, but because the primitives array is a global array with a fixed size defined using a #define in the cpp file this can't be very easily done. You can't really use the #define for the size from another file using extern. You also can't make it an integer because not all c++ compilers support using variables as array size. The solution would probably be to just use an std::vector. The #250 PR introduces a lot of duplicate code for defining reversible primitives Refactoring is not trivial but should be done either way. **Relevant discussion:** This is what I have been wanting to do, but because the primitives array is a global array with a fixed size defined using a #define in the cpp file this can't be very easily done. You can't really use the #define for the size from another file using extern. You also can't make it an integer because not all c++ compilers support using variables as array size. The solution would probably be to just use an std::vector. Aug 31, 2024
@tolauwae tolauwae changed the title The #250 PR introduces a lot of duplicate code for defining reversible primitives Refactoring is not trivial but should be done either way. **Relevant discussion:** This is what I have been wanting to do, but because the primitives array is a global array with a fixed size defined using a #define in the cpp file this can't be very easily done. You can't really use the #define for the size from another file using extern. You also can't make it an integer because not all c++ compilers support using variables as array size. The solution would probably be to just use an std::vector. The #250 PR introduces a lot of duplicate code for defining reversible primitives Aug 31, 2024
@tolauwae tolauwae changed the title The #250 PR introduces a lot of duplicate code for defining reversible primitives PR #250 introduces a lot of duplicate code for defining reversible primitives Aug 31, 2024
@tolauwae tolauwae moved this to Scheduled in WARDuino Roadmap Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Refactoring of the code
Projects
Status: Scheduled
Development

No branches or pull requests

2 participants