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
not-after?
not semantically equivalent to <=
despite documentation implying otherwise
#98
Comments
Good catch. The zero arities don't make much sense to me, but I'd rather go a deprecation route than fixing them. Perhaps we can introduce a couple of new predicates, say, |
I think it's fine to deprecate and replace, if the current name doesn't make sense for the new semantics. But I have no experience with public library design, so I can't provide any further suggestions on that. I will provide more feedback under the PR directly, so that we don't disperse things. |
Oh, right, would it be impractical to make all affected types implement ordering as part of their interfaces? Because the problem could be entirely side-stepped, at that point. |
There's another way that (jt/not-after? (jt/local-date 2023 11 14) (jt/local-date 2023 11 12) (jt/local-date 2023 11 13))
;=> true It seems that (jt/not-after? (jt/local-date 2023 11 14) (jt/local-date 2023 11 12))
;=> false This is because The same issue exists with |
The documentation for
not-after?
recites:The documentation for
before?
states:This seems to imply that
not-after?
should be semantically equivalent to<=
, but it is not when invoked like:If semantically equivalent, this s-expression should have returned
true
. Note thatbefore?
is, in fact, semantically equivalent to<
:This issue seems to be a consequence of how
not-after?
is defined as the complement ofafter?
, as the latter is consistent with the behavior of>
:The same applies to
not-before?
.Not sure if this is intended behavior or not, but I found it rather confusing. In addition, when one of these functions is
apply
-ed, the client code is forced to explicitly check for the arity 1 case and override the result of the evaluation, like so:The text was updated successfully, but these errors were encountered: