Skip to content
Ambrose Bonnaire-Sergeant edited this page Jan 12, 2013 · 1 revision
  • Strings are not actually Seqable, but are treated as such in the Clojure implementation

Two suggested fixes:

  • hardcode String <: (Seqable Character)
    • need to be careful that (instance? Seqable a) does not infer that a could be a String.
      • this seems unlikely to be a problem
    • this just says: positions we can use (Seqable Character), we can also use String
  • make Seqable an alias that includes String
    • this ignores that other Clojure implementations have Seqable as a protocol

Arrays, Java maps and others also have this problem, each being hardcoded to behave as a Seqable.

Clone this wiki locally