Fork me on GitHub
#nbb
<
2022-06-19
>
aynish11:06:05

hey i'm having some trouble using anonymous functionns in map. I'm using the (fn [x] (...)) syntax since I know bb doesn't support #(%), however i keep running into null pointer errors? I'm trying to evaluate this s expression: (filter (fn [x] (.contains (get :url x) "bandcamp")) {:url "bandcamp"})

borkdude11:06:51

@anish_slack bb and nbb do support #(%) syntax, but the .edn file format doesn't support it, which are two different things :)

borkdude11:06:40

You can get a NPE if (get :url x) return nil which it does since (get :url x) should probably be written as (get x :url)?

aynish11:06:08

hahaha, i just figured that out too

aynish11:06:11

thank you borkdude!

aynish11:06:24

does this mean i can use #(%) in clj files that are run by bb?

borkdude11:06:31

yes, definitely

aynish11:06:38

oh that's awesome