Skip to content

Instantly share code, notes, and snippets.

@swannodette
Created November 14, 2014 21:01
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swannodette/436196e9d22a5164f837 to your computer and use it in GitHub Desktop.
Save swannodette/436196e9d22a5164f837 to your computer and use it in GitHub Desktop.
(ns interop.core
(:require [cljs.nodejs :as nodejs]))
(nodejs/enable-util-print!)
(def Immutable (js/require "immutable"))
(extend-type Immutable.List
ISeqable
(-seq [coll]
(es6-iterator-seq (js-invoke coll "@@iterator"))))
(defn -main []
(println
(split-with #(< % 5)
(Immutable.List #js [0 1 2 3 4 5 6 7 8 9]))))
;; will print [(0 1 2 3 4) (5 6 7 8 9)]
(set! *main-cli-fn* -main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment