Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created April 12, 2016 22:33
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 anonymous/7f2d86b1895bebb1aa573febaf3b99f8 to your computer and use it in GitHub Desktop.
Save anonymous/7f2d86b1895bebb1aa573febaf3b99f8 to your computer and use it in GitHub Desktop.
(defn printList [str arr]
(map (fn [n]
(cond
(string? n) "String"
:else (printList "Goo" n)))
(map-indexed vector arr)))
;This is the Ruby code of the function
;def printList(str, arr)
; arr.each_with_index do |val,index|
; if val.is_a? String
; puts "#{str}.#{index}: #{val}"
; else
; printList("#{str}.#{index}", val)
; end
; end
;end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment