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

Transit TaggedValue should implement IComparable #28

Open
domkm opened this issue Sep 27, 2016 · 2 comments
Open

Transit TaggedValue should implement IComparable #28

domkm opened this issue Sep 27, 2016 · 2 comments

Comments

@domkm
Copy link

domkm commented Sep 27, 2016

Does it make sense for Transit BigIntegers and BigDecimals to be comparable?

The specific issue that I ran into is that Transit values cannot be indexed by DataScript:

Uncaught Error: Cannot compare [TaggedValue: n, 37502364230516917834597274526242608522740435501611847496456113203943353843903] to [TaggedValue: n, 37746944873274413711073286601178981016490453790917975016109108374206467768511]
    at cljs$core$compare (core.cljs:2241)
    at datascript$db$cmp_val (db.cljc:288)
    at datascript$db$cmp_datoms_avet (db.cljc:311)
    at datascript$btset$binary_search_l (btset.cljc:72)
    at datascript$btset$_seek (btset.cljc:951)
    at datascript$btset$_slice (btset.cljc:979)
    at Function.datascript.btset.slice.cljs$core$IFn$_invoke$arity$3 (btset.cljc:990)
    at datascript$btset$slice (btset.cljc:985)
    at Function.datascript.btset.slice.cljs$core$IFn$_invoke$arity$2 (btset.cljc:988)
    at datascript$btset$slice (btset.cljc:985)
@theronic
Copy link

Maybe raise this on DataScript repo?

@tonsky
Copy link

tonsky commented Mar 28, 2018

Not related to DataScript at all.

TaggedValue shouldn’t implement IComparable, it’s a sign your transit reader isn’t doing its job. It’s a wrapper to store anything transit doesn’t know how to read. Find what to translate it to, register transit handler and make sure the type you’ll be translating to is comparable. Fix that, and DataScript will be happy.

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

No branches or pull requests

3 participants