ClojureScript

chunked-seq? hard-wired for concrete types is problematic for RRB trees

Details

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

Description

RRB trees can support chunked seqs without a problem, but they need their own implementation, as the one in cljs.core uses PersistentVector's array-for. Since chunked-seq? is currently hard-wired to check for the built-in chunked seq types as an optimization for for and doseq, it returns false for such custom chunked seqs.

This can be solved by using satisfies? with false passed in as the extra check-native argument. Happily the performance difference is negligible.

Patch forthcoming.

Activity

Hide
Michał Marczyk added a comment -

Did I mention that ternary satisfies? is awesome?

Show
Michał Marczyk added a comment - Did I mention that ternary satisfies? is awesome?
Hide
David Nolen added a comment -

Heh, I've been thinking that we need another test, perhaps called implements? which does what satisfies? false does now - I think it be less of an eye sore and communicate the difference.

Show
David Nolen added a comment - Heh, I've been thinking that we need another test, perhaps called implements? which does what satisfies? false does now - I think it be less of an eye sore and communicate the difference.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: