obb

rossputin 2022-01-20T21:29:16.002900Z

hi - trying to figure out how much clojure I can use with obb… wondering if I can slurp a file in the same directory as the script - currently getting an Error (Could not resolve symbol slurp) - thanks!

zane 2022-01-20T21:29:47.003100Z

Hey there!

zane 2022-01-20T21:30:30.003300Z

obb is a ClojureScript interpreter, and slurp is Clojure-only.

rossputin 2022-01-20T21:31:16.003500Z

whoops - didn’t read enough of the docs… hopped over from babashka - my bad

zane 2022-01-20T21:31:20.003700Z

No worries!

zane 2022-01-20T21:31:39.003900Z

For reading a file you’ll want to fall back on JavaScript (JXA) interop.

👍 1
zane 2022-01-20T21:31:47.004100Z

Here’s an example of one way to do it: https://github.com/babashka/obb/blob/main/src/obb/impl/core.cljs#L22...L25

rossputin 2022-01-20T21:32:08.004600Z

excellent - thanks for the help!

👍🏻 1
zane 2022-01-20T21:33:03.004900Z

You’re welcome! Thanks for trying out obb!

borkdude 2022-01-20T21:48:26.005100Z

we could expose slurp in obb.core perhaps, this is what I've done in nbb too, but there I made the result a promise so I can eventually supporting slurping urls too ;)

borkdude 2022-01-20T21:48:40.005300Z

this needs careful consideration