<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 class="">Technically Erlang does have arrays—see “erl -man array” for details.</div><div class=""><br class=""></div><div class="">-Rick</div><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 25, 2015, at 4:42 PM, Christopher Vance <<a href="mailto:cjsvance@gmail.com" class="">cjsvance@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">The argument is a tuple. Erlang does not have arrays; you have to decide whether to use a list or a tuple.</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Jan 26, 2015 at 12:36 AM, Roelof Wobben <span dir="ltr" class=""><<a href="mailto:r.wobben@home.nl" target="_blank" class="">r.wobben@home.nl</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000" class="">
<div class="">Nope, Thanks for the patience with me.<br class="">
<br class="">
So area is the function with 1 argument a array with the shape and
the parameters to calculate it.<br class="">
<br class="">
Roelof<br class="">
<br class="">
<br class="">
<br class="">
Hynek Vychodil schreef op 25-1-2015 om 14:23:<br class="">
</div><div class=""><div class="h5">
<blockquote type="cite" class="">
<div dir="ltr" class="">Sorry, typo I mean area/1 and arity 1 because you
have only one parameter.</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Sun, Jan 25, 2015 at 1:24 PM, Roelof
Wobben <span dir="ltr" class=""><<a href="mailto:r.wobben@home.nl" target="_blank" class="">r.wobben@home.nl</a>></span>
wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000" class="">
<div class="">Sorry, now im totally confused .<br class="">
<br class="">
where does the name array come from and why a arity 1 ?<br class="">
<br class="">
Roelof<br class="">
<br class="">
<br class="">
Hynek Vychodil schreef op 25-1-2015 om 13:07:<br class="">
</div>
<div class="">
<div class="">
<blockquote type="cite" class="">
<div dir="ltr" class="">Hi,
<div class=""><br class="">
</div>
<div class="">You don't have any functions named square,
circle or triangle. You have only one function
array/1 with four function clauses, the first
for square, the second for circle, the third for
triangle and the fourth catch-all one.</div>
<div class=""><br class="">
</div>
<div class="">Hynek</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Sun, Jan 25, 2015 at
12:29 PM, Roelof Wobben <span dir="ltr" class=""><<a href="mailto:r.wobben@home.nl" target="_blank" class="">r.wobben@home.nl</a>></span>
wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks,<br class="">
<br class="">
That error messages disappear.<br class="">
<br class="">
As I understand it right. The eror message is
on all functions so on the square, circle and
triangle functions.<br class="">
And if not so, why also not a error functions
on the other two.<br class="">
<br class="">
Roelof<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
Taavi Talvik schreef op 25-1-2015 om 12:22:
<div class="">
<div class=""><br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Until you
export your functions, they remain local
to<br class="">
module. And compiler sees here, that
they are not used<br class="">
locally here.<br class="">
<br class="">
Try adding<br class="">
-export([area/1]).<br class="">
<br class="">
best regards,<br class="">
taavi<br class="">
On 25 Jan 2015, at 13:12, Roelof Wobben
<<a href="mailto:r.wobben@home.nl" target="_blank" class="">r.wobben@home.nl</a>>
wrote:<br class="">
<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Hello,<br class="">
<br class="">
I have this programm :<br class="">
<br class="">
-module(shapes).<br class="">
<br class="">
-import(math, [sqrt/1]).<br class="">
<br class="">
area({square, Side}) -><br class="">
Side * Side ;<br class="">
<br class="">
area({circle, Radius}) -><br class="">
math:pi() * Radius * Radius;<br class="">
<br class="">
area({triangle, A, B, C}) -><br class="">
S = (A + B + C)/2,<br class="">
math:sqrt(S*(S-A)*(S-B)*(S-C));<br class="">
<br class="">
area(Other) -><br class="">
{error, invalid_object}.<br class="">
<br class="">
<br class="">
As soon I as try to compile it , I see
these messages :<br class="">
<br class="">
<br class="">
6> c(shapes).<br class="">
shapes.erl:5: Warning: function area/1
is unused<br class="">
shapes.erl:15: Warning: variable
'Other' is unused<br class="">
<br class="">
Why does Erlang do this?<br class="">
On compile time you cannot see which
functions are used and which not in my
oponion.<br class="">
<br class="">
Roelof<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
erlang-questions mailing list<br class="">
<a href="mailto:erlang-questions@erlang.org" target="_blank" class="">erlang-questions@erlang.org</a><br class="">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank" class="">http://erlang.org/mailman/listinfo/erlang-questions</a><br class="">
</blockquote>
<br class="">
</blockquote>
<br class="">
_______________________________________________<br class="">
erlang-questions mailing list<br class="">
<a href="mailto:erlang-questions@erlang.org" target="_blank" class="">erlang-questions@erlang.org</a><br class="">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank" class="">http://erlang.org/mailman/listinfo/erlang-questions</a><br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</blockquote>
<br class="">
</div>
</div>
</div>
<br class="">
_______________________________________________<br class="">
erlang-questions mailing list<br class="">
<a href="mailto:erlang-questions@erlang.org" target="_blank" class="">erlang-questions@erlang.org</a><br class="">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank" class="">http://erlang.org/mailman/listinfo/erlang-questions</a><br class="">
<br class="">
</blockquote>
</div>
<br class="">
</div>
</blockquote>
<br class="">
</div></div></div>
<br class="">_______________________________________________<br class="">
erlang-questions mailing list<br class="">
<a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank" class="">http://erlang.org/mailman/listinfo/erlang-questions</a><br class="">
<br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature">Christopher Vance</div>
</div>
_______________________________________________<br class="">erlang-questions mailing list<br class=""><a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">http://erlang.org/mailman/listinfo/erlang-questions<br class=""></div></blockquote></div><br class=""></body></html>