<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 1, 2015 at 3:08 AM, Roelof Wobben <span dir="ltr"><<a href="mailto:r.wobben@home.nl" target="_blank">r.wobben@home.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Bob Ippolito schreef op 1-2-2015 om
11:24:<br>
</div><div><div class="h5">
<blockquote type="cite">
<div dir="ltr">The goal is to solve the problem as stated such
that it would work for *any* example, not just that one. It's
very easy to come up with an example that does not work with
your implementation.
<div><br>
</div>
<div>Perhaps you should read the source for the lists module,
and take the time to try and understand it. <a href="https://github.com/erlang/otp/blob/maint/lib/stdlib/src/lists.erl" target="_blank">https://github.com/erlang/otp/blob/maint/lib/stdlib/src/lists.erl</a></div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Sun, Feb 1, 2015 at 2:14 AM, Roelof
Wobben <span dir="ltr"><<a href="mailto:r.wobben@home.nl" target="_blank">r.wobben@home.nl</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I have this exercise of the Erlang programming book.<br>
<br>
Write a function that, given a list of lists, will
concatenate them.<br>
Example:<br>
concatenate([[1,2,3], [], [4, five]]) ⇒ [1,2,3,4,five].<br>
Hint: you will have to use a helpfunction and concatenate
the lists in several steps.<br>
<br>
But I do not need to use a helper function because it can be
solved like this :<br>
<br>
concatenate( [List1 , List2 , List3] ) -><br>
List1 ++ List2 ++ List3.<br>
<br>
Or is this not the solution that is meant on this exercise ?<br>
Do I need to solve it by using pattern matching ?<br>
<br>
Roelof<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br></div></div>
Thanks, I will do this,<br>
<br>
But there is one problem.<br>
<br>
The source is full of -spec and in programming erlang that is
explained in chapter 18 where Im trying exercises of chapter 3.</div></blockquote><div><br></div><div>Well, just ignore the -spec annotations. They are essentially structured documentation, they don't change the behavior of the program. </div></div></div></div>