-
Notifications
You must be signed in to change notification settings - Fork 2
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 new functions add_array and add_hash #374 #379
Conversation
The are a copy of the current implementation of set_array and set_hash. This is a preparation for #309
As a preliminary work for #309 since set_array will change its behaviour but add_array will keep the functionality.
As a preliminary work for #309 since set_array will change its behaviour but add_array will keep the functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to change all set_*
implementations to delegate to the corresponding add_*
functions, so we don't have to maintain two identical implementations for each pair until the former have been replaced.
I would also argue that we should keep set_*
where appropriate, because these are the "standard" functions; the new functions aren't supported by Catmandu (yet).
Similarly, all the tests should be left untouched in order to surface any actual behaviour changes once the set_*
implementations are changed. Just add new ones where appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree about suggestions by @blackwinter.
@blackwinter like this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks!
The new functions need to be documented, though.
As for the tests, I assume that we will want to introduce them once the behaviour gets changed (switch existing failing tests to add_*
, add matching new tests for set_*
).
Resolves #374
This is a preparation for #309 which will change the behavior of all
set-
functions asset_array
andset_hash
which will not create the intermediate structure of a path.Since we rely in context of oersi and lobid on this specific functionality I introduced
add_array
andadd_hash
which copy the current implementation ofset_array
andset_hash
.I also changed the tests from set_array and set_hash to add_array and add_hash since #307 will need new integration tests and java tests.