It’s my 5th time trying to follow this video and things finally start to click in my head. So I think if I write down what is talked in the video, then I can just read my blog post for another 15 times instead of going through the video, that would be convenient.
OK, here is a gist of it. This guy is writing an Scheme interpreter in Scheme.
Let’s start from setting up the environment first so we can type along afterwards.
It’s 5 o’clock on a sunny Friday afternoon, you are thinking where to have dinner with friends and such. The only thing you have to finish before you can go is to pull your colleage’s latest changes and make a demo build to customer. You pull, there are 20 commits all nicely structured, you are now giving yourself a pat on the back for teaching him to use rebase yesterday (by pointing him to these 2 wonderful articles 1 and 2).
In part I we went through how to use git rebase to modify commit history, things like reword a commit, squash multiple commits, split commit. In this part, we will talk about another common use case of rebase: rebase before merging branches.
Let’s first create a new repo and add one file.txt as the first commit.
apple pear peach cat dog snake Now we create a feature branch from master branch.
Magit is arguably the best Git tool out there and also my favorite. It is a package in Emacs, and it is text based. In this tutorial, we will explore how to use it to tackle one of the more elusive topics in Git: Rebase.
In the beginning there was darkness Let’s create an empty repository and add one empty file to it.
git init touch file.txt git add . git commit -m 'first commit' Rewording commit Now let’s add some fruits in the file.
Being a programmer, you should be very familiar with Fibbonacci numbers. It is often being introduced when teaching recursion.
Tree Recursion Most likely the implementation of a function that calculate fib number is as follows:
(defn fib-tree [n] (cond (= n 0) 0 (= n 1) 1 :else (+ (fib-tree (- n 1)) (fib-tree (- n 2))))) This is just a direct translation from the Fibonacci number definition. Since it is straightforward and easy to understand, most textbooks use it as an typical example for illustrating recursive function.