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

Add optional initializer! function to LazyBufferCache #111

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

SouthEndMusic
Copy link
Member

Fixes #110

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

@SouthEndMusic SouthEndMusic changed the title Add optional initializer! function to LazyBufferCache Add optional initializer! function to LazyBufferCache Jul 31, 2024
@SouthEndMusic SouthEndMusic changed the title Add optional initializer! function to LazyBufferCache Add optional initializer! function to LazyBufferCache Jul 31, 2024
@ChrisRackauckas ChrisRackauckas merged commit 20791bc into SciML:master Jul 31, 2024
13 checks passed
@hexaeder
Copy link
Contributor

hexaeder commented Aug 5, 2024

Nice addition, but felt a bit breaking since it added a new type parameter, which is necessary for inferring get_tmp calls...
No hard feelings, easy enough to fix. Just commenting to raise awareness :)

@thomvet
Copy link
Contributor

thomvet commented Aug 5, 2024

As a reference, an earlier discourse discussion on this topic: https://discourse.julialang.org/t/is-adding-a-type-parameter-to-a-struct-a-breaking-change/111236

The change implemented here concerned the implementation of the type (new type parameter), but the interface change was implemented in a non-breaking way (default argument to constructor that kept behavior the same).

One can argue that fields and parameters of types are ultimately implementation details and that guarantees apply only to the interface in which the types are used. That would make this technically a non-breaking change, even though it obviously broke your code in this instance.

@ChrisRackauckas
Copy link
Member

Julia's dispatch is specifically designed so that new type parameters can be omitted so that adding new parameters does not break existing code.

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

Successfully merging this pull request may close these issues.

Support passing a cache initialization function for LazyBufferCache
4 participants