In the section "Functional programming for real" he states:<p>> Note that the order of the definitions is important: had we moved our base case at the bottom, the recursion would never finish because map(F, [H|T]) would always match (remember? an empty list is also a list with a head and a tail).<p>Which confuses me a bit, since I am used to the empty list <i>not</i> having a head (I am thinking for example of Haskell). Is it true that in Erland the empty list has a head? And what would it be? Some generic null object?
I have written a more quickly paced Erlang tutorial some years ago, it is not even online anymore, but here is a copy from archive.org:<p><a href="http://web.archive.org/web/20080708140354/http://www.stifflog.com/2007/05/09/erlang-for-the-practical-man/" rel="nofollow">http://web.archive.org/web/20080708140354/http://www.stifflo...</a><p>I must shamelessly say it seems to have aged reasonably well, unlike some other things I wrote I actually read it now with interest, especially I haven't dabbled in Erlang since and forgot some details.<p>I recommend everyone who finds fun in programming to give Erlang a shot, I don't think it's great for all the use cases (what is?), but, for example, for writing servers of all kinds it's totally awesome, especially with OTP, which I didn't cover in my tutorial. It's also completely different from everything else, even if you know Prolog or Haskell/ML, which are related in some ways. One day I would really like to get myself together and write something like a game server for poker or bridge in it.
This is a pretty good introduction and is pretty accessible on first pass through.<p>However, a factual error:: "(remember? an empty list is also a list with a head and a tail)."<p>An empty list is an empty list :) You could switch the order of those two function heads and 'map' would still behave properly.
For anyone finding the syntax of list comprehensions a bit confusing (like me), I found this comparison to be useful if you're familiar with the more readable (usually) Python equivalent:<p><pre><code> [expression(element) || element <- list, conditions]
</code></pre>
is the same as<p><pre><code> [expression(element) for element in list if condition]</code></pre>