Yesterday a coworker need a few excel spreadsheets (tab delimited) stitched together. I took this as an opportunity to test run my proposed string functions. Here's what I found:
Good stuff * Having re-split be lazy is awesome. This made partially traversing a row super quick. * The str-before/after methods were useful for trimming headers. * Having :offset in re-split was also useful for skipping the first few lines. * Passing an options map is useful. * I needed to create a hashmap with one of the columns as a key. Having trim as a clojure function made the code cleaner. * I couldn't have delivered what my coworker needed without the currently existing chop and chomp functions. Thanks to the original str-utils authors! Bad Stuff * Some of the proposed mutlimethod functions look cool on paper, but don't get used in practice. Suppling a list to re-split and re- partition is not as useful as I thought, and I needed to use a normal map operation instead * The :marshal-fn parameter wasn't as useful as I thought, either. Again, I used a normal map operation instead. The biggest challenge was learning to write the stitcher application in a functional style. Once my brian started to make the switch from Ruby to Clojure, it really helped. Anyway, the code it on github, and now has a build.xml file, so you can build that jar. I'd really appreciate more feedback on the library. I hope other people find this useful. Happy Hacking! On Mar 26, 1:55 am, Tom Faulhaber <tomfaulha...@gmail.com> wrote: > Having great string and regex manipulation is a must for anything that > will be used as a scripting language and I think this should be > conveniently available in Clojure. > > So, yes, I agree that these functions are ones that it makes sense to > wrap. > > I'm not (yet, at least) commenting specifically on Sean's proposal, > because I haven't had time to look at it in depth, > > Tom --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---