This file contains hidden or 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
update_spec_alpha () { | |
git grep -l clojure.spec | xargs sed -i '' 's/clojure.spec /clojure.spec.alpha /g' | |
git grep -l clojure.spec | xargs sed -i '' 's/clojure.spec.test /clojure.spec.test.alpha /g' | |
git grep -l clojure.spec | xargs sed -i '' 's/clojure.spec.gen /clojure.spec.gen.alpha /g' | |
} |
This file contains hidden or 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
Retrieving banks-0.1.9.pom from s3p://sparkfund-maven/releases/ | |
Could not transfer artifact sparkfund:banks:pom:0.1.9 from/to sparkfund (s3p://sparkfund-maven/releases/): Cannot run program "aws": error=2, No such file or directory | |
Retrieving jimfs-1.2.0.pom from s3p://sparkfund-maven/releases/ | |
Could not transfer artifact sparkfund:jimfs:pom:1.2.0 from/to sparkfund (s3p://sparkfund-maven/releases/): Cannot run program "aws": error=2, No such file or directory | |
java.lang.Thread.run Thread.java: 745 | |
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 617 | |
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 1142 | |
org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run RunnableErrorForwarder.java: 60 | |
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run WagonRepositoryConnector.java: 601 | |
This file contains hidden or 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
(defn- multi-perm | |
"Handles the case when you want the permutations of a list with duplicate items." | |
[l] | |
(let [f (frequencies l), | |
v (vec (distinct l)), | |
indices (apply concat | |
(for ^{::t/ann (t/Coll Long)} [^{::t/ann Long} i (range (count v))] | |
(repeat (f (v i)) i)))] | |
(map (partial map v) (lex-permutations indices)))) |
This file contains hidden or 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 clojure.core.typed.test.rt-infer.loop | |
{:lang :core.typed | |
:core.typed {:features #{:runtime-infer}}} | |
(:require [clojure.core.typed :as t])) | |
(defn b [coll] | |
(loop [c coll | |
out []] | |
(if (seq c) | |
(recur (next c) (conj out (inc (first c)))) |
This file contains hidden or 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 clojure.core.typed.test.rt-infer.anon-lambda | |
{:lang :core.typed | |
:core.typed {:features #{:runtime-infer}}} | |
(:require [clojure.core.typed :as t])) | |
(defn b [coll] | |
(->> coll | |
(map (fn [n] | |
(inc n))) | |
(filter |
This file contains hidden or 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
(ann even (All [a] | |
(IFn [Int -> Boolean] | |
[(I a (Not Int)) -> (I a (Not Int))]))) | |
(defn even [a] | |
(cond | |
(integer? a) (even? a) | |
:else a)) | |
; (even 1) ; can't type check this yet... WIP |
This file contains hidden or 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
1. Clone this repository https://github.com/frenchy64/clojurescript/tree/tools.analyzer-ast | |
2. Checkout the `tools.analyzer.ast` branch. | |
3. `lein install` that branch. | |
4. Now you should have `[org.clojure/clojurescript "0.0-SNAPSHOT"]` in your maven repo | |
5. You now have push rights to `https://github.com/typedclojure/core.typed`. | |
6. I'll soon have a CLJS branch we can all work on. | |
Relevant files: | |
- the clojurescript type checker | |
- https://github.com/typedclojure/core.typed/blob/master/module-check/src/main/clojure/clojure/core/typed/check_cljs.clj |
This file contains hidden or 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
(require '[clojure.pprint :refer [pprint]]) | |
(defn binary-str [bitmap] | |
(let [s (Integer/toBinaryString bitmap)] | |
(if (= 32 (count s)) | |
s | |
(str (apply str (repeat (- 32 (count s)) \0)) | |
s)))) | |
;; get a feel for 2's complement |
This file contains hidden or 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 prim-wrap | |
(:require [clojure.math.combinatorics :as comb])) | |
(declare wrap-prim) | |
(defn instrument-var [vr] | |
(wrap-prim vr @vr)) | |
(def prim-invoke-interfaces | |
(into #{} |
This file contains hidden or 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 runtime-infer-demo.server-port | |
{:lang :core.typed | |
:core.typed {:features #{:runtime-infer}}} | |
(:require [clojure.core.typed :as t] | |
[clojure.spec :as s])) | |
(deftest configure-server-port-test | |
(is | |
(= (-> | |
(configure-server-port |