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
public static java.lang.Object invokeStatic(java.lang.Object, java.lang.Object, java.lang.Object); | |
Code: | |
0: bipush 10 | |
2: anewarray #13 // class java/lang/Object | |
5: dup | |
6: iconst_0 | |
7: getstatic #17 // Field const__0:Lclojure/lang/Keyword; | |
10: aastore | |
11: dup | |
12: iconst_1 |
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
;; differences from scheme unfold | |
;; even initial value is lazy | |
;; predicate sense reversed | |
;; internal state == produced value, no special mapper-fn | |
;; no tail-gen | |
(defn series | |
"Produces a sequence of values. | |
`f` is a function that given a value, returns the next value. | |
`continue?` is a predicate that determines whether to produce |
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
;; | |
;; Example usages at the bottom of the file | |
;; | |
(defn productions | |
"Returns a sequence of values by repeatedly calling `produce!` until it | |
returns `fin`. The sequence can be used lazily/caching or reducible/non-caching. | |
The arity-2 variant's `produce!` takes no arguments and returns a value | |
or the terminator. |
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
(deftype DataWrapper [prop-map obj] | |
clojure.lang.ILookup | |
(valAt [_ k] | |
(when-let [getter (prop-map k)] | |
(getter obj))) | |
(valAt [_ k not-found] | |
(if-let [getter (prop-map k)] | |
(getter obj) | |
not-found)) | |
clojure.lang.IKVReduce |
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
(defmacro doseqs | |
[seq-exprs & body] | |
(let [stk (gensym "stack__") | |
level (gensym "level__") | |
seq-exprs (partition 2 seq-exprs) | |
bindings (vec (map first seq-exprs)) | |
init-exprs (vec (map second seq-exprs)) | |
nbinds (count init-exprs) |
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 docker-tag-paginate | |
(:require [clj-http.lite.client :as client] | |
[cheshire.core :as json] | |
[clojure.pprint :refer [print-table]])) | |
(def base-url "https://registry.hub.docker.com/v2") | |
;; (progression pos? dec 15) | |
(defn progression |
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 JSON '{json [whitespace value EOI] | |
value (/ string number object array jtrue jfalse jnull) | |
object [(:ws "{") | |
(:join [string (:ws ":") value] ",") | |
(:ws "}") | |
(action capture-object)] |
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 poolboy.chanfut | |
(:import [java.util.concurrent CompletableFuture Callable Future] | |
[java.util.function BiConsumer] | |
[java.util.concurrent Executor ExecutorService]) | |
(:require [clojure.core.async :as async] | |
[clojure.core.async.impl.protocols :as async-impl])) | |
(def async-executor clojure.core.async.impl.exec.threadpool/the-executor) | |
(defprotocol Interruptible |
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
import clojure.lang.RT; | |
import clojure.lang.IFn; | |
import clojure.lang.AFn; | |
import java.util.Iterator; | |
import java.util.ArrayList; | |
import java.util.NoSuchElementException; | |
public class XFIterator implements Iterator { |
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
(let* | |
[c__6072__auto__ | |
(clojure.core.async/chan 1) | |
captured-bindings__6073__auto__ | |
(clojure.lang.Var/getThreadBindingFrame)] | |
(clojure.core.async.impl.dispatch/run | |
(clojure.core/fn | |
[] | |
(clojure.core/let | |
[f__6074__auto__ |