ClojureScript

sebseq and sorted-set-by

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:

Description

ClojureScript:cljs.user> (subseq (sorted-set-by <= 1 2 3 4 5) >= 2 <= 4)
"Error evaluating:" (subseq (sorted-set-by <= 1 2 3 4 5) >= 2 <= 4) :as "cljs.core.subseq.call(null,cljs.core.sorted_set_by.call(null,cljs.core.LTEQ,1,2,3,4,5),cljs.core.GTEQ,2,cljs.core.LTEQ,4);\n"
org.mozilla.javascript.JavaScriptException: Error: No protocol method IMapEntry.-key defined for type null: (cljs/core.cljs#211)
at cljs/core.cljs:211 (anonymous)
at cljs/core.cljs:203 (_key)
at cljs/core.cljs:5535 (key)
at cljs/core.cljs:2479 (anonymous)
at cljs/core.cljs:1791 (lazy_seq_value)
at cljs/core.cljs:1840 (anonymous)
at cljs/core.cljs:238 (_seq)
at cljs/core.cljs:343 (seq)
at cljs/core.cljs:817 (anonymous)
at cljs/core.cljs:854 (anonymous)
at cljs/core.cljs:857 (anonymous)
at cljs/core.cljs:868 (anonymous)
at cljs/core.cljs:5925 (anonymous)
at cljs/core.cljs:5937 (anonymous)
at <cljs repl>:1 (anonymous)
at <cljs repl>:1

Activity

Hide
Erik Ouchterlony added a comment -

I found a small bug in the last patch, so I attached a new one. This patch handles both the remaining issues.

Show
Erik Ouchterlony added a comment - I found a small bug in the last patch, so I attached a new one. This patch handles both the remaining issues.
Hide
Erik Ouchterlony added a comment -

Here is a patch for the third issue.

Show
Erik Ouchterlony added a comment - Here is a patch for the third issue.
Hide
Erik Ouchterlony added a comment -

Only 3.

Show
Erik Ouchterlony added a comment - Only 3.
Hide
David Nolen added a comment -

So does the patch address both 1 & 3 or only 3?

Show
David Nolen added a comment - So does the patch address both 1 & 3 or only 3?
Hide
Erik Ouchterlony added a comment -

I've done some further analysis on this problem and found three different issues:

  1. The sorted-set-by in cljs doesn't support ordinary boolean operators, only comparison functions with values -1,0,1.
  2. Bug in PersistentTreeSet lookup. Resolved in CLJS-394
  3. Bug in PersistentTreeMap -sorted-seq-from. I have attached a patch that seems to resolve the issue.
Show
Erik Ouchterlony added a comment - I've done some further analysis on this problem and found three different issues:
  1. The sorted-set-by in cljs doesn't support ordinary boolean operators, only comparison functions with values -1,0,1.
  2. Bug in PersistentTreeSet lookup. Resolved in CLJS-394
  3. Bug in PersistentTreeMap -sorted-seq-from. I have attached a patch that seems to resolve the issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: