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

Bengt Kleberg bengt.kleberg@REDACTED
Wed Aug 19 14:16:28 CEST 2015


Greetings,

Please read the documentation for the lists module,
http://www.erlang.org/doc/man/lists.html

It has many useful functions for handling lists.


bengt

On 08/19/2015 02:13 PM, Roelof Wobben wrote:
> oke, but I do not have a list of tuples but a list of lists that 
> contain tuples,
>
> So I have this  [ [ {1,2}, {2,3}],  [ { 1,3} , { 2,1} ] ]
>
> and I do experiment a lot in erl but I seem to be lost.
>
> Roelof
>
>
> Op 19-8-2015 om 14:05 schreef Kenneth Lakin:
>> 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.
>>
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
> ------------------------------------------------------------------------
> Avast logo <https://www.avast.com/antivirus> 	
>
> Dit e-mailbericht is gecontroleerd op virussen met Avast 
> antivirussoftware.
> www.avast.com <https://www.avast.com/antivirus>
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150819/00b55bbb/attachment.htm>


More information about the erlang-questions mailing list