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 merge-methods [[defaults provideds]] | |
(let [explicitize (fn [[fname args & body]] | |
[[(meta fname) fname (list (meta args) (map meta args)) args] body]) | |
implicitize (fn [[[_ name _ args] body]] | |
`(~name ~args ~@body)) | |
defaults (apply hash-map (mapcat explicitize defaults)) | |
provideds (apply hash-map (mapcat explicitize provideds)) | |
methods (merge defaults provideds)] | |
(map implicitize methods))) |
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.reader | |
(:refer-clojure :exclude [read read-line read-string]) | |
(:import (clojure.lang BigInt Numbers PersistentHashMap PersistentHashSet PersistentArrayMap IMeta ISeq | |
RT IReference Symbol IPersistentList Reflector Var Symbol Keyword IObj | |
IPersistentCollection IRecord) | |
(java.util ArrayList regex.Pattern) | |
java.lang.reflect.Constructor)) | |
(set! *warn-on-reflection* true) |
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.reader | |
(:refer-clojure :exclude [read read-line read-string]) | |
(:import (clojure.lang BigInt Numbers PersistentHashMap PersistentHashSet PersistentArrayMap IMeta ISeq | |
RT IReference Symbol IPersistentList Reflector Var Symbol Keyword IObj) | |
(java.util ArrayList regex.Pattern) | |
java.lang.reflect.Constructor)) | |
(set! *warn-on-reflection* true) | |
(defprotocol PushbackReader |
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.reader | |
(:refer-clojure :exclude [read read-line read-string]) | |
(:import (clojure.lang BigInt Numbers PersistentHashMap PersistentHashSet PersistentArrayMap IMeta ISeq | |
RT IReference Symbol IPersistentList Reflector Var) | |
(java.util ArrayList regex.Pattern))) | |
(set! *warn-on-reflection* true) | |
(defprotocol PushbackReader | |
(read-char [reader] "Returns the next char from the Reader, nil if the end of stream has been reached") |
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.reader | |
(:refer-clojure :exclude [read read-line read-string]) | |
(:import (clojure.lang BigInt Numbers PersistentHashMap PersistentHashSet PersistentArrayMap IMeta ISeq | |
RT IReference Symbol IPersistentList Reflector Var) | |
(java.util ArrayList regex.Pattern))) | |
(set! *warn-on-reflection* true) | |
(defprotocol PushbackReader | |
(read-char [reader] "Returns the next char from the Reader, nil if the end of stream has been reached") |
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.reader | |
(:refer-clojure :exclude [read read-line]) | |
(:import (clojure.lang BigInt Numbers))) | |
(set! *warn-on-reflection* true) | |
(defprotocol PushbackReader | |
(read-char [reader] "Returns the next char from the Reader, nil if the end of stream has been reached") | |
(unread [reader ch] "Push back a single character on to the stream")) |
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.reader | |
(:refer-clojure :exclude [read read-line]) | |
(:import (clojure.lang BigInt Numbers))) | |
(set! *warn-on-reflection* true) | |
(defprotocol PushbackReader | |
(read-char [reader] "Returns the next char from the Reader, nil if the end of stream has been reached") | |
(unread [reader ch] "Push back a single character on to the stream")) |
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
(defprotocol PushbackReader | |
(read-char [reader] "Returns the next char from the Reader, nil if the end of stream has been reached") | |
(unread [reader ch] "Push back a single character on to the stream")) | |
(defmacro update! [what f] | |
(list 'set! what (list f what))) | |
;;not thread-safe, but i guess i don't care? | |
(deftype StringPushbackReader | |
[^:unsynchronized-mutable ^String s ^"[C" buf ^:unsynchronized-mutable len ^:unsynchronized-mutable buf?] |
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
(defprotocol PushbackReader | |
(read-char [reader] "Returns the next char from the Reader, nil if the end of stream has been reached") | |
(unread [reader ch] "Push back a single character on to the stream")) | |
(defmacro update! [what f] | |
(list 'set! what (list f what))) | |
;;not thread-safe, but i guess i don't care? | |
(deftype StringPushbackReader | |
[^:unsynchronized-mutable ^String s ^"[C" buf ^:unsynchronized-mutable len ^:unsynchronized-mutable buf?] |
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
(defprotocol PushbackReader | |
(read-char [reader] "Returns the next char from the Reader, nil if the end of stream has been reached") | |
(unread [reader ch] "Push back a single character on to the stream")) | |
(defmacro update! [what f] | |
(list 'set! what (list f what))) | |
;;not thread-safe, but i guess i don't care? | |
(deftype StringPushbackReader | |
[^:unsynchronized-mutable ^String s ^"[C" buf ^:unsynchronized-mutable len ^:unsynchronized-mutable buf?] |