Fork me on GitHub
#rewrite-clj
<
2021-04-06
>
martinklepsch10:04:43

I’m trying to elide dead feature flag branches from our codebase and rewrite-clj seems to be the tool for that type of thing 🙂

martinklepsch10:04:24

Right now I have a big function that returns something that is wrapped in <forms: … > . I tried rewrite-clj.zip/string to just turn it into a regular string but that didn’t work (same for root-string ). In particular I’m getting the following error:

rewrite_clj.node.forms.FormsNode cannot be cast to clojure.lang.IFn

martinklepsch10:04:54

Duh, just str works 😄

👍 1
lread11:04:03

Glad you got things working @martinklepsch! Without seeing your code it is hard for me to guess why the zip API’s string fns were not working for you. Could it be that you were calling these fns on nodes rather than a zipper?

martinklepsch11:04:21

Yeah it seems so

borkdude11:04:23

I didn't even know z/string existed, I've always just used str :)

martinklepsch11:04:38

Honestly no idea why I didn’t just try that hahaha

lread11:04:24

Well, the nice thing is we got a visit from you here in the rewrite-clj channel! 🙂

martinklepsch11:04:53

always here to entertain 😂

martinklepsch11:04:07

but yeah, I was thinking the same, it’s nice when the circle closes 🙂

❤️ 1