[erlang-questions] How can I make a list of this

Kenneth Lakin kennethlakin@REDACTED
Wed Aug 19 14:05:16 CEST 2015


On 08/19/2015 04:10 AM, Roelof Wobben wrote:
> Still my question stands. How do I get a nice list of the ourcome of the
> exports of the functions ot more then 1 module.

Richard O'Keefe demonstrated that lists:sort/1 will -when given a list
of tuples- sort that list. He also presented code that will -when given
a sorted list of tuples- give you a count of the number of distinct
elements in that list. He *also* presented code that will -when given a
list of tuples of the form {fun, arity}- pretty print them in just the
way that you appear to require.

Does your project require more than this? :)

Here's a bit of unasked-for advice from an old guy who's been
programming for way too long.

It is sometimes helpful to step away from your code and your desk, go
somewhere else and carefully restate -in a human language- the problem
that you're trying to solve. When doing this, I find it helpful to
entirely forget about the code I have written. It's easy to assume that
the code that you've already written solves the problem you intend to
solve. If you're not sure that you're on the right track, it's good to
make as few assumptions as possible when verifying your current course.

I've worked myself into a state of confusion in which I have lost the
understanding of the problem I'm trying to solve more times than I care
to admit. In most of those cases, stepping away and re-familiarizing
myself with the problem at hand dispelled the confusion.

Another piece of unasked-for advice: If I recall correctly, you
mentioned that you're teaching yourself Erlang. If this is true, then
you probably don't have any hard deadlines to contend with. Take time to
peruse manuals and read user's guides. Take time to play around with
code in the Erlang shell. Take time to play with code that folks hand
you in response to your queries.

I learn non-rote things best when I'm not stressed out and I allow
myself to play around and experiment. Perhaps I'm atypical.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150819/c50d775e/attachment.bin>


More information about the erlang-questions mailing list