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
; Clojure 1.6.0-alpha3, CLJS HEAD, [org.clojure/core.async "0.1.267.0-0d7780-alpha"] | |
; works | |
(go (loop [change (<! dom-change-chan)] | |
(when change | |
(js/console.log change) | |
(recur (<! dom-change-chan))))) | |
; doesn't work | |
(go-loop [change (<! dom-change-chan)] |
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
$ lein repl | |
Compiling com.clojurebook.CustomException | |
Compiling com.clojurebook.imaging | |
nREPL server started on port 59292 on host 127.0.0.1 | |
REPL-y 0.2.1 | |
Clojure 1.3.0 | |
Docs: (doc function-name-here) | |
(find-doc "part-of-name-here") | |
Source: (source function-name-here) | |
Javadoc: (javadoc java-object-or-class-here) |
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
cemerick.pprng> (defn x [] 5) | |
#<Var@15e1180b: | |
#<pprng$eval8963$x__8964 cemerick.pprng$eval8963$x__8964@4dabde1e>> | |
cemerick.pprng> (tc/ann x (Fn [-> tc/AnyInteger])) | |
nil | |
cemerick.pprng> (tc/cf (x)) | |
Type Error (/tmp/form-init6942836557449375495.clj:1:16) Unannotated var cemerick.pprng/x | |
Hint: Add the annotation for cemerick.pprng/x via check-ns or cf | |
in: x |
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
(tc/defprotocol IRandom | |
(-seed [this] :- tc/AnyInteger) | |
(-next-double [this] :- Double) | |
(-next-float [this] :- Float) | |
(-next-int | |
[this] :- Integer | |
[this limit :- Integer] :- Integer) | |
(-next-long [this] :- Long) | |
(-next-boolean [this] :- Boolean)) |
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
; This Source Code Form is subject to the terms of the Mozilla Public License, | |
; v. 2.0. If a copy of the MPL was not distributed with this file, You can | |
; obtain one at http://mozilla.org/MPL/2.0/. | |
(ns cemerick.atlas.classpath | |
(:import (java.net URI) java.io.File)) | |
(defn- find-clojure-jar | |
"Returns a file referring to the clojure jar on the classpath." | |
[] |
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
(def-repl-test ensure-no-*msg*-capture | |
(let [ids (set (map :id (repl-eval session "(println :foo)"))) | |
ids2 (set (map :id (repl-eval session "(println :bar)")))] | |
(println ids) | |
(println ids2) | |
(is (empty? (clojure.set/intersection ids ids2))))) |
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
clojure.test.check.generators> (sample bytes) | |
(#<[object Uint8Array]> #<[object Uint8Array]> #<[object Uint8Array]> #<[object Uint8Array]> #<[object Uint8Array]> #<[object Uint8Array]> #<[object Uint8Array]> #<[object Uint8Array]> #<[object Uint8Array]> #<[object Uint8Array]>) | |
clojure.test.check.generators> (lang/map #(.-length %) *1) | |
(0 0 2 3 2 4 5 7 1 8) |
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
(define-pass optimize-direct-call L0 [x] L0 | |
[] | |
{Expr | |
[[((fn [x*] e*) e1*) | |
(== (count x*) (count e1*)) | |
`(let [~@(interleave x* e1*)] ~@e*)]]} | |
(Expr x)) | |
lang> (optimize-direct-call '((fn [a b] _) 1 2)) | |
(clojure.core/let [a 1 b 2] _) |
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
; CIDER 0.6.0alpha (package: 0.5.0) (Clojure 1.6.0, nREPL 0.2.3) | |
=> (schedule #(println "foo")) | |
=> (schedule #(println "foo")) | |
=> (schedule #(println "foo")) | |
... | |
=> (def s (immutant.scheduling.internal/scheduler {})) | |
#<Var@5f67764a: | |
#<QuartzScheduling org.projectodd.wunderboss.scheduling.QuartzScheduling@450109d4>> | |
; scheduled job names (and thus their JobKeys) are retained, even if they're not repeating |
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
$ lein repl | |
nREPL server started on port 50811 on host 127.0.0.1 - nrepl://127.0.0.1:50811 | |
REPL-y 0.3.2, nREPL 0.2.3 | |
Clojure 1.6.0 | |
Java HotSpot(TM) 64-Bit Server VM 1.8.0_40-b25 | |
Docs: (doc function-name-here) | |
(find-doc "part-of-name-here") | |
Source: (source function-name-here) | |
Javadoc: (javadoc java-object-or-class-here) | |
Exit: Control+D or (exit) or (quit) |
OlderNewer