core: close surfaced gaps — first-class sorted colls, with-out-str, rand arity, deref reduced
jolt-ti9: sorted-map/sorted-set are now first-class across the collection fns — get/assoc/dissoc/conj/contains?/keys/vals/disj and call-as-fn all operate on the wrapper and preserve sort order. The by-comparator constructors (sorted-map-by/ sorted-set-by) now thread the user comparator (numeric or boolean-predicate) through all derived colls. Sorted predicates/ctors/ops moved above core-conj so the collection fns can branch on them; jolt-invoke (interpreter) gets inline branches. jolt-rfw: add with-out-str (binds output to a string buffer) + the macro. jolt-ek3: (rand n) arity and deref-of-reduced (uuid? still deferred). Specs: new io-spec.janet; sorted-spec expanded to pin the now-working map/set ops and by-comparator ordering; predicate/number spec restorations.
This commit is contained in:
parent
ae8b635602
commit
afef55704c
7 changed files with 174 additions and 30 deletions
|
|
@ -12,6 +12,11 @@
|
|||
|
||||
(defmacro comment [& body] nil)
|
||||
|
||||
;; with-out-str: capture everything the body prints to *out* and return it as a
|
||||
;; string. __with-out-str (clojure.core) runs the thunk with the output captured.
|
||||
(defmacro with-out-str [& body]
|
||||
`(__with-out-str (fn* [] ~@body)))
|
||||
|
||||
;; defmulti/defmethod are sugar over defmulti-setup/defmethod-setup (ctx-capturing
|
||||
;; clojure.core fns) so they compile as plain invokes. name/mm are passed quoted;
|
||||
;; the dispatch fn, options, and dispatch value evaluate normally, and the method
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue