Inequality predicates seem to match nonsensical types #179
Labels
No labels
A-build
A-cli
A-core
A-design
A-edn
A-ffi
A-query
A-sdk
A-sdk-android
A-sdk-ios
A-sync
A-transact
A-views
A-vocab
P-Android
P-desktop
P-iOS
bug
correctness
dependencies
dev-ergonomics
discussion
documentation
duplicate
enhancement
enquiry
good first bug
good first issue
help wanted
hygiene
in progress
invalid
question
ready
size
speed
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: greg/mentat#179
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It seems like the types returned by the inequality predicates (
>
,>=
,<
,<=
) aren't limited to what is vaguely sensible.To reproduce, you can copy/paste the following into the mentat CLI:
Which will output (a bunch of TxReports, followed by):
Note that
[(> ?v 0)]
matches strings, keywords, and uuids, in addition to the types that seem intentional that it matches (e.g. doubles, longs, instants, and refs -- I'm assuming these are intentional, since a similarly broad<
will return those, but not the strings/keywords/uuids).In fact, it always seems to include the nonsense types, no matter how large I make the second argument to
>
(I've tried1.79e308
and9223372036854775807
, at least).This seems to exhibit itself when comparing if a variable is larger than a constant. For constant values of
$k
,[(> ?v $k)]
and[(>= ?v $k)]
both cause the issue, as do[(< $k ?v)]
and[(<= $k ?v)]
. But not when comparing if a constant is larger than a variable, e.g.[(< ?v $k)]
,[(<= ?v $k)]
,[(> $k ?v)]
and[(>= $k ?v)]
all seem to behave correctly.