Public Vars

Back

doall (clj)

(source)

function

(doall coll) (doall n coll)
When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. doall can be used to force any effects. Walks through the successive nexts of the seq, retains the head and returns it, thus causing the entire seq to reside in memory at one time.

Examples

hraberg/deuce
(ns deuce.emacs.emacs
  (:use [deuce.emacs-lisp :only (defun defvar) :as el])
  (:require [clojure.core :as c]
            [deuce.emacs.alloc :as alloc]
            [deuce.emacs.fns :as fns]
            [deuce.emacs.terminal :as terminal]
            [deuce.emacs-lisp.globals :as globals])
  (:import [java.io File])
  (:refer-clojure :exclude []))

  The value of `kill-emacs-hook', if not void,
  is a list of functions (of no args),
  all of which are called before Emacs is actually killed."
  (interactive "P")
  (doall (map #(%) globals/kill-emacs-hook))
  (terminal/delete-terminal)
  (System/exit (if (integer? arg) arg 0)))
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/doall (t/All [[c :< (t/U nil t/AnySeqable)]]
                [(t/? t/AnyInteger) c :-> c])
cc/dorun [(t/? t/AnyInteger) t/AnySeqable :-> nil]
cc/iterate (t/All [x]
                  [[x :-> x] x :-> (t/NonEmptyASeq x)])
cc/memoize (t/All [x y :..]
                  [[y :.. y :-> x] :-> [y :.. y :-> x]])
re-path/studio
(ns renderer.tools.page
  (:require
   [clojure.core.matrix :as mat]
   [clojure.string :as str]
   [goog.string :as g.str]
   [re-frame.core :as rf]
   [reagent.dom.server :as dom]
   [renderer.element.handlers :as element.h]
   [renderer.tools.base :as tools]
   [renderer.utils.pointer :as pointer]
   [renderer.utils.units :as units]))

(defmethod tools/render-to-string :page
  [{:keys [attrs children]}]
  (let [child-elements @(rf/subscribe [:element/filter-visible children])
        attrs (->> (dissoc attrs :fill)
                   (remove #(empty? (str (second %))))
                   (into {}))]
    (g.str/unescapeEntities
     (dom/render-to-static-markup
      [:svg attrs
       (doall (map tools/render-to-string (merge child-elements)))]))))
halgari/clojure-tutorial-source
(ns core-async-tutorials.episode18
  (:require [clojure.core.async :as async
             :refer [go <! >! <!! >!! put! take!]]))

(let [c (async/chan 1)]
  (go (doall (map <! [c c c]))))
PacktPublishing/Clojure-Programming-Cookbook
(ns chapter04.kafka
  (:require
   [clj-kafka.producer :as p]
   [clj-kafka.core :as core]
   [clj-kafka.consumer.zk :as zk]
   [clj-kafka.new.producer :as new]
   [clj-kafka.consumer.simple :as simple]
   [clj-kafka.offset :as offset]
   [clj-kafka.admin :as admin]
   [clojure.core.async :as async :refer :all]
   )
        (:import (kafka.consumer Consumer ConsumerConfig KafkaStream)
           (kafka.producer KeyedMessage ProducerConfig)
           (kafka.javaapi.producer Producer)
           (java.util Properties)
           (java.util.concurrent Executors))
  )
;;=> nil

(def x (core/with-resource [c (zk/consumer consumer-config)]
         zk/shutdown
         (doall (take 1 (zk/messages c "test")))
         ))
;=> #'chapter04.kafka/x

(core/with-resource [c (zk/consumer consumer-config)]
  zk/shutdown
  (doall (take 1 (zk/messages c "test"))))