I saw this on twitter.

http://pastie.org/796264

The problem: given a list of strings, produce a list where sequential
non-empty strings are concatenated

# Conditions: Do not use iteration.
#
# Example: glom (["a", "b", "c"]) = ["abc"]
#          glom (["a", "", "b"]) = ["a", "b"]
#          glom (["a", "b", "", "c"]) = ["ab", "c"]
#          glom (["a", "b", "", "", "c"]) = ["ab", "c"]


The author had rules like, don't use iteration and avoid recursion.

anyone have any clever solutions? My first reaction was to use reduce, but
I'm not sure how that'd work.

-- 
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
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