<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class="">Hi Roelof,</div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class="">Here you go:</div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class="">1> [[{sorted, lists:sort(X)}, {count, length(X)}] || X <- [inet:module_info(exports)]].</div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class="">...</div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class=""><div style="margin: 0px;" class="">2> [get_rc/0].                                                    </div><div style="margin: 0px;" class="">** exception error: an error occurred when evaluating an arithmetic expression</div><div style="margin: 0px;" class="">     in operator  '/'/2</div><div style="margin: 0px;" class="">        called as get_rc / 0</div></div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class="">What the book/lesson is trying to teach is probably not how to do basic operations on lists (which is notionally the point of the exercise). It’s actually trying to get you to reach for the right tool to do the job by getting you to explore the platform libraries and the power of the platform for yourself.</div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class="">Yes, I cheated above and used a comprehension above to present the answers you want, and also showed what happens when you get what you originally asked for. Likely you didn’t learn much from that, since what I typed in was born of spending time with the libraries and knowing what to do with a problem I’m presented with and understanding what erlang tells you when you get it “wrong".</div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class="">You need to be patient and find your own solutions to things, since if you are merely taking others’ solutions, you will never become a “power user”. It’s a hard slog, I don’t deny that.</div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class="">However, the REPL, particularly in your early learning lets you try things out instantly, and is invaluable help in breaking down a problem. You can try individual steps extremely easily - and in a way that is simply not possible with non-functional languages.</div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class="">If it’s any help or encouragement, it took me months to “grok” erlang and its unfamiliar ways, but once I had, I realized what I was missing. Each day, even after a few years, I learn something new and positive about the platform. It’s also been an empowerment in my relationship to computers; I can express concepts that would be essentially intractable in many popular languages.</div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class="">I wish you well in your journey (one that I have personally experienced) and offer the thought that it’s likely more rewarding, and more empowering in the long term, to sit with a problem, read the documentation that comes with Erlang (which is extremely good despite its many critics) and *find your own solution* than to look outside for help too quickly. </div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class="">Sure if you get totally stuck, there’s help here.</div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class="">I can promise you that the long path and all the hard work to becoming an “erlang ninja” will be worth every second.</div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: 'Courier New';" class="">/s</div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>