Created
April 12, 2016 22:33
-
-
Save anonymous/7f2d86b1895bebb1aa573febaf3b99f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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