Fork me on GitHub

Is there any way to set default ns in Babashka preloads? I have preloads.clj file loaded via (load-file) and I want to run bb '(foo)' instead of bb '(preloads/foo)'


I found workaround export BABASHKA_PRELOADS=cat preloads.clj`` but removed (ns preloads) in the begining of the file


yeah, that is the correct workaround, just define your functions in the user namespace


With babashka I started to forget linux commands and their complex parameters. I think about to create preloads.clj file with common functions like: ls, grep, find, etc., but with clojure syntax and more simple parameters. Is there any examples of such preloads files with a bunch of every day functions?


@mike1452 That's a great idea. I'm not aware of anyone who did this yet.


I need a hammock time. ๐Ÿ˜›babashka


First function:

(defn whoami
  (System/getProperty ""))

๐ŸŽ‰ 2
Leah Neukirchen21:09:58

Am I doing this wrong or doesn't this library work with bb?

rhea ~mess%ย cat bb.edn
{:deps {fr.jeremyschoffen/prose-alpha {:mvn/version "30"}}}
rhea ~mess%ย bb -e "(require '[fr.jeremyschoffen.prose.alpha.reader.core :as reader])"
----- Error --------------------------------------------------------------------
Type:     clojure.lang.ExceptionInfo
Message:  Could not resolve symbol: *clojure-version*
Location: clojure/tools/reader/impl/utils.clj:17:35


That's one of the issues. I don't know what this project uses. Co-incidentally, it does offer ability to run within SCI so you could compile your own graalvm binary which can run this stuff

Leah Neukirchen21:09:12

note that the code is pulled in from


Leah Neukirchen21:09:29

hmhm, then it goes on with

java.lang.Exception: Unable to resolve classname: [at clojure/tools/reader/reader_types.clj:14:3]

Leah Neukirchen21:09:54

i'll try the other way then


we can add Closeable for sure, but probably not support tools.reader from source right now. I see it also uses instaparse which is also complicated probably

Leah Neukirchen21:09:19

i thought was more core than it is, it's fine ๐Ÿ™‚


oh it probably loads because it loads sci :)


and sci definitely cannot run itself right now ;)

clojure-spin 1