This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-04
Channels
- # announcements (1)
- # babashka (41)
- # beginners (124)
- # cider (8)
- # clj-kondo (25)
- # cljs-dev (40)
- # clojars (4)
- # clojure (92)
- # clojure-europe (35)
- # clojure-italy (3)
- # clojure-nl (4)
- # clojure-uk (91)
- # clojuredesign-podcast (8)
- # clojurescript (41)
- # code-reviews (1)
- # cursive (11)
- # data-science (1)
- # datascript (76)
- # datomic (45)
- # emacs (4)
- # etaoin (3)
- # events (1)
- # figwheel-main (2)
- # fulcro (9)
- # graalvm (1)
- # jackdaw (6)
- # jobs (1)
- # jobs-discuss (3)
- # kaocha (4)
- # malli (25)
- # off-topic (42)
- # pathom (4)
- # reitit (11)
- # releases (2)
- # reveal (1)
- # shadow-cljs (53)
- # sql (4)
- # tools-deps (190)
- # vrac (19)
- # xtdb (6)
Thanks @goomba! Yes, #spire is a sister project by @retrogradeorbit based on the same interpreter #sci
Can be handy to know: https://twitter.com/borkdude/status/1301836039129104385
$ bb -Xmx0m -e "(+ 1 2 3)"
java.lang.OutOfMemoryError: Garbage-collected heap size exceeded.
$ bb -Xmx5m -e "(+ 1 2 3)"
6
Heya! I wanted to compare some versions in a babashka script and discovered that https://github.com/xsc/version-clj works with babashka. Worth adding to https://github.com/borkdude/babashka/blob/master/doc/libraries.md#libraries?
hmm:
user=> (version-compare "1.0-alpha5" "1.0-alpha14")
java.lang.StackOverflowError
$ bb -e "(use 'version-clj.core) (version->seq \"1.0.0-SNAPSHOT\")"
----- Error --------------------------------------------------------------------
Type: java.lang.StackOverflowError
Location: version_clj/split.clj:63:5
I was testing from the bb repl like so:
> bb --repl
Babashka v0.2.0 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.
user=> (require '[version-clj.core :as ver])
nil
user=> (ver/version->seq "1.0.0-SNAPSHOT")
[(1 0 0) ["snapshot"]]
user=> (ver/version-compare "1.0-alpha5" "1.0-alpha4")
1
user=> (ver/version-compare "1.0-alpha4" "1.0-alpha5")
-1
And setup my bb cp like so:
export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {version-clj {:mvn/version "0.1.2"}}}')
this indeed seems to work:
$ bb -e "(require '[version-clj.core :as ver])" -e '(ver/version->seq "1.0.0-SNAPSHOT")'
[(1 0 0) ["snapshot"]]
But this doesn't:
$ bb -e "(use '[version-clj.core])" -e '(version->seq "1.0.0-SNAPSHOT")'
There may be a bug in the implementation of sci's use :)What I usually do for libraries like this is copy the tests to test-resources and add it to the lib tests script
here’s the issue: https://github.com/borkdude/babashka/issues/565
Thanks. Meanwhile I made a small repro which may be similar:
(ns foo
(:refer-clojure :exclude [+]))
(defn- + [& xs]
(apply + xs))
(ns bar (:use foo))
(+ 1 2 3)
I’ll hold off on adding to libraries docs until this is fixed. Note that I won’t get to it immediately.