Skip to content

Instantly share code, notes, and snippets.

@lagenorhynque
Created May 24, 2018 08:46
Show Gist options
  • Select an option

  • Save lagenorhynque/e2d3844eba0048d84dac3ec4437f34eb to your computer and use it in GitHub Desktop.

Select an option

Save lagenorhynque/e2d3844eba0048d84dac3ec4437f34eb to your computer and use it in GitHub Desktop.
(defn fib [n]
(case n
0 0
1 1
(+ (fib (- n 1))
(fib (- n 2)))))
(let [x (-> *command-line-args*
first
js/parseInt)]
(doseq [n (range x)]
(println (fib n))))
@lagenorhynque

lagenorhynque commented May 24, 2018

Copy link
Copy Markdown
Author
# Install Lumo
$ npm install -g lumo-cljs
# Run CLJS script
$ lumo fibonacci.cljs 10
0
1
1
2
3
5
8
13
21
34

cf. https://github.com/anmonteiro/lumo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment