filmov
tv
Learn Clojure 13. Recursion - Clojure Koans Walkthrough in Light Table IDE

Показать описание
This video introduces recursion, which is a key concept in functional programming. Although the JVM does not support tail-call optimization, Clojure has a trick up it's sleeve to accomplish the same thing via the special "recur" operator. In this way you can do recursive looping without consuming any stack space.
The Clojure Koans Walkthrough screencast tutorial helps you learn the Clojure programming language. Experience the joy of Clojure in the Light Table IDE as we tour through the Clojure Koans, taking you all the way from Beginner to Intermediate to Advanced.
defn is-even?
defn is-even-bigint? [n]
defn recursive-reverse [coll]
defn factorial
meditations
"Recursion ends with a base case"
"And starts by moving toward that base case"
"Having too many stack frames requires explicit tail calls with recur"
"Reversing directions is easy when you have not gone far"
"Yet more difficult the more steps you take"
"Simple things may appear simple."
"They may require other simple steps."
"Sometimes a slightly bigger step is necessary"
"And eventually you must think harder"
"You can even deal with very large numbers"
"But what happens when the machine limits you?"
Комментарии