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 cljc.core | |
| (:refer-clojure :exclude [fn reify deftype])) | |
| (defmacro reify | |
| [& impls] | |
| `(clojure.core/reify ~@impls)) | |
| (defmacro deftype | |
| [t fields & impls] | |
| `(clojure.core/deftype ~t ~fields ~@impls)) |
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
| (macroexpand '(fn | |
| ([x] x) | |
| ([x & xs] (cons x xs)))) | |
| => | |
| (clojure.core/with-meta | |
| (cljc.core/reify | |
| clojure.lang.Fn | |
| clojure.lang.IFn | |
| (invoke [G__4128 G__4129] (let [[x] [G__4129]] x)) | |
| (invoke |
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) | |
| (declare cons) | |
| (defprotocol ISeq | |
| (first [coll]) | |
| (rest [coll]) | |
| (next [coll])) | |
| (defprotocol Seqable |
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 'cl) | |
| (setq custom-file (expand-file-name "~/.emacs.d/custom.el") | |
| ns-use-srgb-colorspace t | |
| ring-bell-function 'ignore | |
| inhibit-startup-message t | |
| initial-scratch-message nil | |
| indent-tabs-mode nil | |
| make-backup-files nil | |
| use-dialog-box nil |
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
| declare i8* @dlopen(i8*, i32) | |
| declare i8* @dlsym(i8*, i8*) | |
| declare i32 @dlclose(i8*) | |
| declare i32 @puts(i8*) | |
| declare i32 @printf(i8*, ...) nounwind | |
| declare i8* @LLVMModuleCreateWithName(i8*) | |
| declare void @LLVMDumpModule(i8*) | |
| @.str = private constant [4 x i8] c"%s\0A\00" | |
| @.llvm = private constant [29 x i8] c"/usr/local/lib/libLLVM.dylib\00" |
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
| (def table | |
| (-> (.getDeclaredField clojure.lang.Keyword "table") | |
| (doto (.setAccessible true)) | |
| (.get nil))) | |
| (defn candidates | |
| [prefix] | |
| (when (= (first prefix) \:) | |
| (for [[kw _] table | |
| :let [kw-name (name kw)] |
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 mock-suggestions-response | |
| [name] | |
| (go (<! (a/timeout (max (rand-int 300) 100))) | |
| {:status 200 | |
| :body (->> (gen/elements [name]) | |
| (gen/tuple (gen/not-empty gen/string-alpha-numeric)) | |
| (gen/fmap | |
| (fn [[noise name]] | |
| (-> (str "www." (str/lower-case name) noise ".com") | |
| (str/replace #" " "")))) |
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
| [:MODULE_BLOCK | |
| {:BlockCodeSize 3, :NumWords 103} | |
| [:VERSION {:op0 1}] | |
| [:BLOCKINFO_BLOCK {}] | |
| [:TYPE_BLOCK_ID | |
| {:BlockCodeSize 4, :NumWords 14} | |
| [:NUMENTRY {:op0 11}] | |
| [:INTEGER {:op0 8}] | |
| [:ARRAY {:abbrevid 9, :op0 14, :op1 0}] | |
| [:POINTER {:abbrevid 4, :op0 1, :op1 0}] |
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
| -- the power of type inference and functional programming! | |
| car (a, b) = a -- inferred type is car :: (t, t1) -> t | |
| cdr (a, b) = b -- ... cdr :: (t, t1) -> t1 | |
| caar = car . car -- caar :: ((c, t), t1) -> c | |
| cadr = car . cdr | |
| cdar = cdr . car | |
| cddr = cdr . cdr | |
| caaar = car . caar | |
| caadr = car . cadr -- inferred type is caadr :: (t2, ((c, t), t1)) -> 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
| (defn classify | |
| [x] | |
| (if (seq? x) | |
| (case (first x) | |
| fn :fn | |
| if :if | |
| let :let | |
| letfn :letfn | |
| quote :quote | |
| try :try |