erp12.fijit.collection

Utilities for converting collections between Clojure and Scala.

->clj

(->clj x)

Converts a Scala collection to its Clojure counterpart. Objects that are not one of the supported immutable Scala collections are returned unchanged.

Mapping:

  • Scala Vector -> Clojure vector
  • Scala Set -> Clojure set
  • Scala Map -> Clojure map
  • Scala List -> Clojure list
  • Scala Seq -> Clojure seq
  • Scala Iterator -> Clojure seq

->scala

(->scala x)

Converts a Clojure collection to its Scala counterpart. Non-collection inputs are returned unchanged.

Mapping:

  • Clojure vector -> Scala Vector
  • Clojure set -> Scala Set
  • Clojure map -> Scala Map
  • Clojure sequential? -> Scala Seq

ju-iter->scala-iter

(ju-iter->scala-iter ju-iter)

map->clj

(map->clj m)

Converts a Scala Map to a clojure map.

scala-iter->ju-iter

(scala-iter->ju-iter scala-iter)

scala-list

(scala-list & args)

Creates a Scala List.

scala-map

(scala-map & keyvals)

scala-seq

(scala-seq & args)

Creates a Scala Seq.

scala-set

(scala-set & args)

Creates a Scala Set.

scala-vector

(scala-vector & args)

Creates a Scala Vector.

seq->clj

(seq->clj s)

Converts a Scala Seq to a clojure seq.

set->clj

(set->clj s)

Converts a Scala Set to a clojure set.

to-scala-array

(to-scala-array coll)(to-scala-array cls coll)

Converts a Clojure collection to a Scala Array.

Like Clojure core into-array, all elements must be of the same class (or nil).

to-scala-iterator

(to-scala-iterator coll)

Converts a Clojure collection to a Scala iterator.

to-scala-list

(to-scala-list coll)

Converts a Clojure collection to a Scala List.

to-scala-map

(to-scala-map m)

Converts a Clojure map to a Scala Map.

to-scala-seq

(to-scala-seq coll)

Converts a Clojure collection to a Scala Seq.

to-scala-set

(to-scala-set coll)

Converts a Clojure collection to a Scala Set.

to-scala-vector

(to-scala-vector coll)

Converts a Clojure collection to a Scala Vector.

vector->clj

(vector->clj v)

Converts a Scala Vector to a clojure vector.