Fix #1722: add new clojure 1.12 vars (#1723)

This commit is contained in:
Michiel Borkent 2024-09-06 18:37:26 +02:00 committed by GitHub
parent a415139b3b
commit bc413b654b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 3 deletions

View file

@ -10,7 +10,8 @@ A preview of the next release can be installed from
## Unreleased
- Upgrade Clojure to `1.12.0`
- [#1720](https://github.com/babashka/babashka/issues/1720): Include `clojure.java.process`
- Fix [#1722](https://github.com/babashka/babashka/issues/1722): add new clojure 1.12 vars
- [#1720](https://github.com/babashka/babashka/issues/1720): Include new clojure 1.12's `clojure.java.process`
- [#1598](https://github.com/babashka/babashka/issues/1598): use Rosetta on CircleCI to build x64 images
- Bump SCI
- Bump `fs`

View file

@ -27,6 +27,7 @@
(def math-context (core-dynamic-var '*math-context*))
(def compile-path (core-dynamic-var '*compile-path* *compile-path*))
(def compiler-options (core-dynamic-var '*compiler-options*))
(def repl (core-dynamic-var '*repl* true)) ;; set to true, basically just a dummy for now
(defn read+string
"Added for compatibility. Must be used with
@ -55,7 +56,7 @@
The rounding mode is one of CEILING, FLOOR, HALF_UP, HALF_DOWN,
HALF_EVEN, UP, DOWN and UNNECESSARY; it defaults to HALF_UP."
[precision & exprs]
(let [[body rm] (if (= (first exprs) :rounding)
(let [[body rm] (if (= :rounding (first exprs))
[(next (next exprs))
`((. java.math.RoundingMode ~(second exprs)))]
[exprs nil])]
@ -195,5 +196,15 @@
'print-dup (sci/copy-var print-dup clojure-core-ns)
'PrintWriter-on (sci/copy-var PrintWriter-on clojure-core-ns)
'set-agent-send-executor! (sci/copy-var set-agent-send-executor! clojure-core-ns)
'set-agent-send-off-executor! (sci/copy-var set-agent-send-off-executor! clojure-core-ns)}
'set-agent-send-off-executor! (sci/copy-var set-agent-send-off-executor! clojure-core-ns)
;; 1.12
'splitv-at (sci/copy-var splitv-at clojure-core-ns)
'stream-transduce! (sci/copy-var stream-transduce! clojure-core-ns)
'partitionv (sci/copy-var partitionv clojure-core-ns)
'stream-into! (sci/copy-var stream-into! clojure-core-ns)
'stream-reduce! (sci/copy-var stream-reduce! clojure-core-ns)
'stream-seq! (sci/copy-var stream-seq! clojure-core-ns)
'partitionv-all (sci/copy-var partitionv-all clojure-core-ns)
'*repl* repl
}
)