Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Loops-N-plus-one-half/Clojure/loops-n-plus-one-half.clj
Normal file
10
Task/Loops-N-plus-one-half/Clojure/loops-n-plus-one-half.clj
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
; Functional version
|
||||
(apply str (interpose ", " (range 1 11)))
|
||||
|
||||
; Imperative version
|
||||
(loop [n 1]
|
||||
(printf "%d" n)
|
||||
(if (< n 10)
|
||||
(do
|
||||
(print ", ")
|
||||
(recur (inc n)))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue