[erlang-questions] How to make this work
Wed Aug 12 19:20:55 CEST 2015
On 08/12, Roelof Wobben wrote:
>Im trying this exercise from the programming erlang book.
Honest advice here is that you really, really need to sit down and read
more carefully through the documentation you have at hand, and to try
experimenting with your programs a bit. We've been through this months
Here's a quick list:
Valid question from the exercise book, because too simple of a solution
was indeed too simple.
correct implementations, but you confused strings and atoms. Those were
exercises from 'Erlang Programming' book. Atoms are introduced on p.19,
the exercises on p.44.
This is a function again from Erlang Programming. The precise
implementation you are looking for for sum_acc/3 is on page 68, and is
not actually an exercise as mentioned
You found a compile error for mismatching heads. I'm not sure when in
the book it is, but I'd like to show you the link
where I compiled the common compile errors, with their explanation and
how to fix them.
Valid enough question about list building, I have little to say here
Error on the syntax of atoms, again introduced on p.19. The error *is*
a bit cryptic though
Exercise from the Erlang programming book. Trying the guards you had
set in the shell with numbers would have revealed the problem directly
(as pointed out in the first response)
Fast forward to this month:
I'll point you for some like this to the same learnyousomeerlang link
in the future, it's also there!
The problem there was an unexported function. The error you saw was
probably something like 'undef'. In this case, and for other errors
happening at runtime, I'd like to redirect you to
which includes descriptions for such errors and ways to fix them in
general. Note that the error is also described on page 70 of Erlang
Dialyzer errors are legitimately confusing for a newcomer!
Valid question from 'make it work -> make it beautiful' as a progress
This very thread. The content there is from Programming Erlang
(Armstrong). If it's the second edition, I don't have it, but in the
first edition, the syntax to functions is explained on page 42. In
Erlang programming (which you also have), it's on page 190, and in
Etudes for Erlang, which you have also looked at, they're explained in
Don't get me wrong, I appreciate people posting to the mailing list. The
thing is, I feel that it would be helpful for *your* learning as a whole
to make use of the resources you have rather than coming to the list as
often as you do. For one, the feedback loop and your progress will be
Out of the 12 email threads I have linked here, at least 6 of them could
have been solved by re-reading the learning material you have in your
hands (because that's where you take exercises and examples from), or by
experimenting rapidly with the shell.
The other half were good questions to ask, so by all means, don't stop
asking questions. Just make sure that you're not using us as your own
Old timers from the industry will tell you stories of when they had to
take punched cards or hand-written programs, had to go to their
university department to make them run, wait hours or days before
finding if things were alright, and then repeating this over again for
When you ask us to solve such problems for you while you have all the
information required, you might just be throwing yourself back 30-40
years in the past in terms of feedback loops!
You've got the material, the tools, and visibly the drive to do that
stuff. It's likely going to be simpler in the long run to make a few
experiments, run them, and see if you can figure it out (or go back and
re-read significant chapters in one of the many books you have on the
topic) than the time it takes for you to write an email and wait for a
More information about the erlang-questions