Stuart, Excellent point about delimiters, parsing CSV is much more sophisticated than my simple s-exp.
However, since you're writing a parser you've worked with strings a lot :) I use something like str-take/str-drop all the time in my parsers. So if you could answer a few questions... 1. Would str-take/drop make your code any easier to write? 2. Would str-take/drop make your code any easier to maintain? 3. What would you add (or remove) from the two functions to help your parsing? 4. If str-take/drop were part of a standard library, would you be more likely to use them? 5. If str-take/drop were part of a standard library, would you be more likely to write about them in your book :-p (Excellent work, btw! Can't wait for print version!) Happy Hacking. Sean On May 14, 9:14 am, Stuart Halloway <stuart.hallo...@gmail.com> wrote: > FYI: I am working on an open-source CSV parser in Clojure. Splitting > on delimiters is rarely enough in my experience. > > Stu > > > would you consider adding support of a split by passing a delimiter? > > since parsing csv/tsv is a pretty common task. > > > I know it can be done by using re-split. but it seems to occur > > common enough that it's not a bad idea. > > > On Thu, May 14, 2009 at 1:12 AM, Sean Devlin > > <francoisdev...@gmail.com> wrote: > > >> Hello again everyone, > >> I've added a few new routines to a string library I've been working > >> on. I mentioned it about a month ago, as a proposed change to str- > >> utils. > > >> Original Thread: > >>http://groups.google.com/group/clojure/browse_thread/thread/42152add4... > > >> Github: > >>http://github.com/francoisdevlin/clojure-str-utils-proposal/tree/master > > >> Most notable I've created two new functions in this addition, > > >> str-take > >> str-drop > > >> They have a simple form > > >> (str-take 7 "Clojure Is Awesome") = > "Clojure" > >> (str-drop 8 "Clojure Is Awesome") = > "Is Awesome" > > >> But the can also take a regex > > >> (str-take #"\s+" "Clojure Is Awesome") = > "Clojure" > >> (str-drop #"\s+" "Clojure Is Awesome") = > "Is Awesome" > > >> You can check the tests and README.html for more usage. > > >> I'm looking for feedback. If anyone else has string functions that I > >> haven't covered, let me know. > > >> Thanks, > >> Sean > > > -- > > Omnem crede diem tibi diluxisse supremum. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---