help with message-passing syntax

im using:
http://www.erlang.org/doc/reference_manual/part_frame.html
but cant really figure it out. i didnt expect this to work but compiled anyway:
2> c("c:/Program Files/erl5.6.2/usr/serec", [{outdir, "c:/Program Files/erl5.6.2/usr/"}]).
c:/Program Files/erl5.6.2/usr/serec.erl:2: function squarer/1 undefined
c:/Program Files/erl5.6.2/usr/serec.erl:2: function squarer2/1 undefined
c:/Program Files/erl5.6.2/usr/serec.erl:23: premature end
error
3>


obv this is just a toy program but say I have a function that squares the integers of a list from 1 to the send parameter.
so i want to send a message to that function.


-module(serec).
-export([seq/2,squarer/1,squarer2/1]).
         
seq(Start, End) -> seq(Start, End, []).

seq(Start, End, Acc) when Start =< End ->
   seq(Start, End-1, [End|Acc]);
seq(_, _, Acc) ->
   Acc.

squarer(X) ->
    receive
    Pattern [when Pattern > 7] ->
        [X*X || X <- [seq(1, 7]];
    end

squarer2(X) ->
    receive
    when X > 7 -> [X*X || X <- [seq(1, 7]];
    end

squarer(X) ! 2+6


Låna pengar utan säkerhet.
Sök och jämför lån hos Kelkoo.
<div>
<table cellspacing="0" cellpadding="0" border="0"><tr><td valign="top">im using:<br>http://www.erlang.org/doc/reference_manual/part_frame.html<br>but cant really figure it out. i didnt expect this to work but compiled anyway:<br>2&gt; c("c:/Program Files/erl5.6.2/usr/serec", [{outdir, "c:/Program Files/erl5.6.2/usr/"}]).<br>c:/Program Files/erl5.6.2/usr/serec.erl:2: function squarer/1 undefined<br>c:/Program Files/erl5.6.2/usr/serec.erl:2: function squarer2/1 undefined<br>c:/Program Files/erl5.6.2/usr/serec.erl:23: premature end<br>error<br>3&gt; <br><br><br>obv this is just a toy program but say I have a function that squares the integers of a list from 1 to the send parameter.<br>so i want to send a message to that function.<br><br><br>-module(serec).<br>-export([seq/2,squarer/1,squarer2/1]).<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>seq(Start, End) -&gt; seq(Start, End, []).<br><br>seq(Start, End, Acc) when Start
 =&lt; End -&gt;<br>&nbsp;&nbsp; seq(Start, End-1, [End|Acc]);<br>seq(_, _, Acc) -&gt;<br>&nbsp;&nbsp; Acc.<br><br>squarer(X) -&gt;<br>&nbsp;&nbsp;&nbsp; receive<br>&nbsp;&nbsp; &nbsp;Pattern [when Pattern &gt; 7] -&gt;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [X*X || X &lt;- [seq(1, 7]];<br>&nbsp;&nbsp;&nbsp; end<br><br>squarer2(X) -&gt;<br>&nbsp;&nbsp;&nbsp; receive<br>&nbsp;&nbsp; &nbsp;when X &gt; 7 -&gt; [X*X || X &lt;- [seq(1, 7]];<br>&nbsp;&nbsp;&nbsp; end<br><br>squarer(X) ! 2+6<br><br>
</td></tr></table>
<br>
L&aring;na pengar utan s&auml;kerhet.<br><a href="http://www.kelkoo.se/c-100390123-lan-utan-sakerhet.html?partnerId=96915014">S&ouml;k och j&auml;mf&ouml;r l&aring;n hos Kelkoo.</a>
</div>

Gmane