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

preview_player
Показать описание

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?"

Рекомендации по теме
Комментарии
Автор

So I’m taking a clojure class and this is like the first video he’s having us watch. I have some python knowledge, but this is just beyond me right now. I feel like I just jumped into a French 3 class or something

damianwilding
Автор

One of the best recursion walkthroughs I've ever seen, really helped me reason about how to approach these types of problems in Clojure, thanks!

ChadStovern
Автор

Nice meditation youve written there - "And eventually you must think harder". Not too much fun, but you gotta do it I guess..Not funny..

utkarshpande
visit shbcf.ru