babashka

kiemdoder 2025-04-24T06:02:44.243039Z

I used to be able to directly call functions defined in clojure files in my script directory like:

;;in bb.edn
{:paths ["script"]
 :tasks {test (my-utils/test)}}
But now I need to require the namespace first for it to work:
;;in bb.edn
{:paths ["script"]
 :tasks 
 {:init (require 'my-utils)
  test (my-utils/test)}}
Was that a change in babashka or am I missing something?

borkdude 2025-04-24T07:10:38.085829Z

If you mention the function without parens it works without a require. With parens itโ€™s an arbitrary expression which needs an explicit require

borkdude 2025-04-24T07:10:55.611169Z

Thatโ€™s always been like that, nothing changed

kiemdoder 2025-04-24T07:15:27.057689Z

Ah, I see now in my older bb projects that "used to work" there are no parens. So PEBCAK ๐Ÿ˜”

๐Ÿ‘ 1
โŒจ๏ธ 1
m3tti 2025-04-24T06:45:06.500529Z

have you defined a namespace? in the script

kiemdoder 2025-04-24T06:45:24.211459Z

I did, yes

kiemdoder 2025-04-24T06:46:14.072409Z

I also tried a namespace without a "-" just in case it was that

m3tti 2025-04-24T06:48:57.864649Z

ok what about no namespace at all?

m3tti 2025-04-24T06:49:07.247409Z

i'm just thinking loud ๐Ÿ˜„

kiemdoder 2025-04-24T06:52:23.675789Z

a clj file with no namespace does not work either

kiemdoder 2025-04-24T06:57:15.766019Z

The extra require in the bb.edn file is not a big deal. I was just curios why it it was not required in the past.