Stuart S,
I have a few ideas for enhancements in stri-utils2

Note:  I am going to add a "str-" prefix to your method for the sake
of discussion

* str-parition

What if this could take an integer as an argument as well?  The
resulting method would look like this

(defmethod str-partition :number
  [s n]
  (map (apply str) (clojure/partition n s)))

* str-take/str-drop

What if these methods could take a regex as well as an integer?  The
methods would look like

(defmethod str-take :regex
  [s re]
  (first (split s re)))

(defmethod str-drop :regex
  [s re]
  (rest (split s re)))

* Add str-take-while/str-drop-while

(def str-take-while
  [s pred]
  (apply str (take-while pred s)))

(def str-drop-while
  [s pred]
  (apply str (take-drop pred s)))

* Make replace variadic

See this gist

http://gist.github.com/172772

*Add Rails style inflectors
Add the following inflectors

(titleize "clojure iS Awesome") =>  "Clojure Is Awesome"
(camleize "clojure iS Awesome") =>  "clojureIsAwesome"
(dasherize "clojure iS Awesome")    =>  "clojure-is-awesome"
(underscore "clojure iS Awesome")   =>  "clojure_is_awesome"

Also, add the keywordize function, which works like dasherize except
it deletes ( ) " ' : #

* Add str->keyword
This function is straightforward.  Very useful in defining data
adapters.

(defn str->keyword
  [s]
  (keyword (keywordize s)))

*  Add split-tabs
It's a cousin to split-lines.

* Add filter-str/remove-str
These are akin to map-str

Let me know what you think
Sean
--~--~---------~--~----~------------~-------~--~----~
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to