rewrite-clj

https://github.com/clj-commons/rewrite-clj
martinklepsch 2021-04-06T10:36:05.199500Z

Hello! ๐Ÿ‘‹

martinklepsch 2021-04-06T10:36:43.200200Z

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 ๐Ÿ™‚

martinklepsch 2021-04-06T10:41:24.201800Z

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

martinklepsch 2021-04-06T10:46:54.202Z

Duh, just str works ๐Ÿ˜„

1๐Ÿ‘
martinklepsch 2021-04-06T10:47:00.202200Z

๐Ÿ˜…

lread 2021-04-06T11:19:03.207400Z

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?

martinklepsch 2021-04-06T11:21:21.207900Z

Yeah it seems so

borkdude 2021-04-06T11:21:23.208Z

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

martinklepsch 2021-04-06T11:21:38.208300Z

Honestly no idea why I didnโ€™t just try that hahaha

lread 2021-04-06T11:27:24.209600Z

Well, the nice thing is we got a visit from you here in the rewrite-clj channel! ๐Ÿ™‚

martinklepsch 2021-04-06T11:32:53.209800Z

always here to entertain ๐Ÿ˜‚

martinklepsch 2021-04-06T11:33:07.210200Z

but yeah, I was thinking the same, itโ€™s nice when the circle closes ๐Ÿ™‚

1โค๏ธ