Public Vars

Back

interpose (clj)

(source)

function

(interpose sep) (interpose sep coll)
Returns a lazy seq of the elements of coll separated by sep. Returns a stateful transducer when no collection is provided.

Examples

typedclojure/typedclojure
(ns ^:no-doc typed.ann.clojure
  "Type annotations for the base Clojure distribution."
  #?(:cljs (:require-macros [typed.ann-macros.clojure :as macros]))
  (:require [clojure.core :as cc]
            [typed.clojure :as t]
            #?(:clj [typed.ann-macros.clojure :as macros])
            #?(:clj typed.ann.clojure.jvm) ;; jvm annotations
            #?(:clj clojure.core.typed))
  #?(:clj
     (:import (clojure.lang PersistentHashSet PersistentList
                            APersistentMap #_IPersistentCollection
                            #_ITransientSet
                            IRef)
              (java.util Comparator Collection))))

cc/interpose (t/All [x] (t/IFn [x :-> (t/Transducer x x)]
                               [x (t/Seqable x) :-> (t/ASeq x)]))
cc/interleave (t/All [x] [(t/Seqable x) :* :-> (t/ASeq x)])
ReactiveX/RxClojure
(ns rx.lang.clojure.core-test
  (:require [rx.lang.clojure.core :as rx]
            [rx.lang.clojure.blocking :as b]
            [rx.lang.clojure.future :as f]
            [clojure.test :refer [deftest is testing are]]))

(deftest test-interpose
  (is (= (interpose \, [1 2 3])
         (b/into [] (rx/interpose \, (rx/seq->o [1 2 3]))))))
gixxi/lambdaroyal-memory
(ns 
    ^{:doc "(Performance) Unittests for lambdaroyal memory search abstraction that builds data projections."
      :author "christian.meichsner@live.com"}
    lambdaroyal.memory.abstraction.test-search-projection
  (:require [midje.sweet :refer :all]
            [lambdaroyal.memory.core.tx :refer :all]
            [lambdaroyal.memory.abstraction.search :refer :all]
            [lambdaroyal.memory.core.context :refer :all]
            [lambdaroyal.memory.helper :refer :all]
            [clojure.core.async :refer [>! alts!! timeout chan go]])
  (:import [java.text SimpleDateFormat])
  (:gen-class))


         ;;some speed test
         (let [[t _] (timed (apply + (map count 
                                          (pmap 
                                           #(proj tx
                                                  (filter-key tx :client %)
                                                  (>>> :order)
                                                  (>>> :part-order)) 
                                           (-> clients count range)))))]
           (append-to-timeseries "projection" (apply str (interpose ";" [t (float (/ (-> ctx deref :part-order :data deref count) 100))])))
           (fact "(parallel) 3x type->order->partorder using the pipe" t => (roughly 30 80)))