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
; Copyright (c) Rich Hickey. All rights reserved. | |
; The use and distribution terms for this software are covered by the | |
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) | |
; which can be found in the file epl-v10.html at the root of this distribution. | |
; By using this software in any fashion, you are agreeing to be bound by | |
; the terms of this license. | |
; You must not remove this notice, or any other, from this software. | |
(ns cljs.compiler | |
#?(:clj (:refer-clojure :exclude [munge macroexpand-1 ensure]) |
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
; Copyright (c) Rich Hickey. All rights reserved. | |
; The use and distribution terms for this software are covered by the | |
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) | |
; which can be found in the file epl-v10.html at the root of this distribution. | |
; By using this software in any fashion, you are agreeing to be bound by | |
; the terms of this license. | |
; You must not remove this notice, or any other, from this software. | |
(ns cljs.compiler | |
#?(:clj (:refer-clojure :exclude [munge macroexpand-1 ensure]) |
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
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 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 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 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 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 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 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 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 |