Skip to content

Instantly share code, notes, and snippets.

@mfikes
Created July 21, 2017 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfikes/fe449f953326d76c04e396238d2f4d34 to your computer and use it in GitHub Desktop.
Save mfikes/fe449f953326d76c04e396238d2f4d34 to your computer and use it in GitHub Desktop.
(ns foo.core
  (:require #?(:cljs [cljs.pprint :as pp]
               :clj [clojure.pprint :as pp]))
  #?(:cljs (:require-macros [cljs.pprint :refer [pprint-logical-block print-length-loop]])))

(defn foo []
  (pp/print-length-loop [a 17]
    (when (pos? a)
      (pp/write a)
      (recur (dec a)))))
cljs.user=> (require 'foo.core)
nil
cljs.user=> (foo.core/foo)
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment