-
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 is_<type>
Fix conditionals.
#247
Conversation
This integration test seems not to work: 29065de |
Your input is not MARCXML! The records are empty (as the diff shows), because |
29065de
to
6c6d08f
Compare
saw this what about numbers that are strings? i think this is difficult to differentiate. I would have not expected that the conditional is false, would have expected this do be true |
That's just not how Catmandu behaves. Do you suggest breaking compatibility here? |
perhaps an option then?
|
I think the natural way to express that would be if we had boolean operators (#165):
In the meantime, a workaround could be to call a macro from both
|
Yes, boolean operators are at the top of my wish list now :) Would you two agree to accept the implementation as is and maybe change it later depending on the outcome of LibreCat/Catmandu#393? |
+1 |
+1 also all seem to work |
Maybe we missed this earlier, but isn't the issue that Metafix doesn't have a numeric data type? Internally, all scalar values are strings. |
Implements a bunch of type-related conditionals from Catmandu.
is_hash()
as alias foris_object()
.is_empty()
as new (semi-related) conditional.Differs from Catmandu in that all scalars in Metafix are strings, we can't actually distinguish between boolean values and boolean strings or numeric values and numeric strings (that's also why
is_true()
/is_false()
are hard-wired tostrict: false
).