Created
November 14, 2014 21:01
-
-
Save swannodette/436196e9d22a5164f837 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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