Programming Erlang Book Club

Another maths orientated thing I spotted (and what left me scratching my head) is on page 54, where we encounter lists:filter(P,L) “which returns a new list of all the elements E in L such that P(E) is true”.

E is easy enough to figure out (elements) as is L (list) but what’s P stand for? Felt like I was missing something :man_shrugging:

On the quicksort example (which is as far as I’ve got atm) I was hoping to be walked through each step of the recursion too, just for that extra bit of reinforcement and clarification of what is going on exactly.

This did get me wondering whether it might be worth reading another Erlang book alongside this book - what’s better than someone teaching you something? Two people teaching you the same thing! :laughing:

I find getting two different perspectives on something can help, hence wondering what you think of reading this alongside Learn You Some Erlang for Great Good! (No Starch Press) (Paid/Free)


Edit:

From the top of this post:

On page 60, it’s explained:

Filters are either predicates (functions that return true or false) or boolean expressions

I don’t think I’ve heard functions that return true or false being described as predicates before, at least not explicitly like this. (Would have been cool if this was mentioned nearer page 54 :upside_down_face: :laughing:)

1 Like