Skip to content

Instantly share code, notes, and snippets.

@jcromartie
Last active December 12, 2015 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcromartie/4686797 to your computer and use it in GitHub Desktop.
Save jcromartie/4686797 to your computer and use it in GitHub Desktop.
//////////////////////////////////////////
// Why it's painful to write Objective-C:
//////////////////////////////////////////
NSString *tagString = [[storyThreadInfo valueForKeyPath:@"interests.name"] componentsJoinedByString:@" "];
;;;;;;;;;;;;;;;;;;;;;;;;;;
;; After writing Clojure:
;;;;;;;;;;;;;;;;;;;;;;;;;;
(->> thread :interests (map :name) (string/join " "))
###########
# Or Ruby:
thread.interests.map(&:name).join(" ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment