Fork me on GitHub
Jakub Holý (HolyJak)16:11:59

Hello! I see file-seq isn't supported, right?


let's see...


apparently not, but I don't see why not. if you like you can make a PR, or I'll do it

Jakub Holý (HolyJak)16:11:08

Btw I need to replace a string in a file. I guess the simplest way is to just call sed from babashka (I don't want to read the whole file in memory, and the string is in the first few lines)


@holyjak Added it. Do you need a new binary, for which OS?

❤️ 4

$ bb '(map #(.getPath %) (file-seq (io/file "src")))' | bb '(take 3 *in*)'
("src" "src/babashka" "src/babashka/impl")

Jakub Holý (HolyJak)21:11:12

FYI I am trying to run a file / send a defn to bb socket repl and I get not very useful

java.lang.IllegalArgumentException: "Don't know how to create ISeq from: clojure.lang.Symbol"
in clojure.core/second--5392 (core.clj:96)
in sci.impl.analyzer/expand-fn-args+body (analyzer.cljc:88)
Now I send a defn to the REPL so I know which part of the file caused it, when I run the whole file with bb -f ... then I had no indication of the location. If possible, it would be very helpful to get better error message and with location in the source file.


if you can be more specific about the input and output, I'm able to help


normally it tries to also include the location, but there might be places where it slips through


I think I have reproduced the error for you:

$ bb '(defn foo (foo)) (foo 1)'


I'll make an issue for it.

Jakub Holý (HolyJak)21:11:28

This is BTW the code that fails, because I unfortunately shadow fn but SCI doesn't get that:

(defn i-fail [fn] (fn 123))


Added it to the issue


I fixed a similar thing before once:

$ bb '(defn foo [defmacro] defmacro) (foo 1)'
I wonder why fn is treated specially here, but I'll find out


aah, it has the same bug when you use the argument as a function call still 🙂


thanks for reporting, this will get fixed soon

Jakub Holý (HolyJak)21:11:22

Thanks to you for the great work!!!