Exercise 3-6: Sorting Lists & 3-7 Using Library Modules

It looks like there’s one other guy on the internet who’s posting his answers for the exercises in this book. So, I’ll be linking to his so you (and I) can compare our answers. He knows what he’s doing. In his posts, he talks about, e.g., what he’d do in Haskell. I’m not a functional programming guy (lisp gives me the heebie-geebies, my earlier post on evolutionary programming where I used it notwithstanding). So, below are my answers (click to see more if you’re looking at the blog and not this post by itself) and here is the Japanese guy’s answers.

Continue reading

Erlang Exercises – Chapter 3

I learn by doing much more than by reading or listening, so as I go through O’Reilly’s Erlang Programming, I take the exercises at the end seriously. Generally, when I learn a new programming language, while I read, I’ll make a program of my own choosing, perhaps something that will be useful to me or that I could sell. However, with Erlang, I don’t even know where to begin using it yet. I want to get really, really good at it before I even attempt to make anything with it (I think remembering the mistakes I made with my first Ruby on Rails project caused this shift in attitude.. and let’s not forget the triumphs of reading Mastering Regular Expressions in its entirety).

I will be posting my attempts at the exercises, in case others might find it useful or seasoned Erlang programmers might tell me what I may be doing wrong. I’ll be spacing out my answers to chapter 3 over the week to keep things interesting. Here are the first three exercises from Chapter 3:
Continue reading