To help myself learn Clojure, I figured I would write a pattern matching / destructing macro to better look like languages I'm more familiar with; i.e., destructuring by [first|second|rest] instead of [first second & rest]. To do this I'm turning the aforementioned vector into a string (via str) and looking for / replacing the | character. However, this led to the following issue...
(def test "abc") (first test) > \a (rest test) > (\b \c) (string? (rest test)) > false It would be really helpful if first/rest returned strings (or a character in the case of first), not lists, when given string input. Is there a design reason for the current behaviour and, if so, are there equivalent built-in functions that do the right thing for strings? -- 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