I hereby claim:
- I am ghadishayban on github.
- I am ghadi (https://keybase.io/ghadi) on keybase.
- I have a public key ASBXbzSnNB9Tcf5AU7PXtLsWEiBhS8jeuA3ZQe9kHQHN0Qo
To claim this, I am signing this object:
| (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 |
| ;; | |
| ;; 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. |
| ;; 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 |
| 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 |
| diff --git a/src/jvm/clojure/lang/BootstrapMethods.java b/src/jvm/clojure/lang/BootstrapMethods.java | |
| index 6eb04ee8..7b163bf3 100644 | |
| --- a/src/jvm/clojure/lang/BootstrapMethods.java | |
| +++ b/src/jvm/clojure/lang/BootstrapMethods.java | |
| @@ -1,56 +1,113 @@ | |
| package clojure.lang; | |
| import java.util.Arrays; | |
| import java.lang.invoke.CallSite; | |
| import java.lang.invoke.ConstantCallSite; |
| (ns sawtooth-signing | |
| (:import org.bitcoinj.core.ECKey | |
| org.bitcoinj.core.DumpedPrivateKey | |
| org.bitcoinj.core.Sha256Hash | |
| org.bitcoinj.core.Utils | |
| org.bitcoinj.params.MainNetParams)) | |
| (def ^{:doc "generates an in-memory priv key representation from the .wif"} | |
| wif->key | |
| (let [MAINNET (MainNetParams/get)] |
| ;; lots of garbage | |
| ;; | |
| (->> coll ;; original collection | |
| (map #(assoc % :foo :bar)) ;; intermediate Chunked collection 1 | |
| (filter :baz) ;; intermediate Chunked collection 2 | |
| (map :feature) ;; intermediate Chunked collection 3 | |
| (into [])) ;; reduction using #'conj over Chunked collection #3 | |
| ;; -- direct reduction using transducers -- |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| # author Ghadi Shayban <[email protected]> | |
| set -e | |
| if [ -z ${1+x} ] | |
| then | |
| echo provide an asm git sha / ref | |
| exit 1 | |
| fi |
| (import '[java.lang.reflect Method Modifier]) | |
| (set! *warn-on-reflection* true) | |
| (defn- samsig | |
| "Given a SAM interface, returns the j.l.reflect.Method of the abstract method" | |
| [sym] | |
| (let [kls (resolve sym)] | |
| (if (and (class? kls) (.isInterface ^Class kls)) | |
| (let [mid (fn [^Method m] [(.getName m) (vec (.getParameterTypes m))]) |