summaryrefslogtreecommitdiffhomepage
path: root/erlang.html.markdown
diff options
context:
space:
mode:
authorAdam <adam@adambard.com>2014-09-11 16:17:21 +0200
committerAdam <adam@adambard.com>2014-09-11 16:17:21 +0200
commita7c89acfcf2eb1cd5e172b8f3d5fabccabcd2003 (patch)
tree65257f3b763b9dddde6d3ecc264d06b06cc4cc74 /erlang.html.markdown
parent3addfcf7148c8da62c3523de7fff7ea55d31084a (diff)
parent6c0018c4b7457e0bf9873627af366b349b194637 (diff)
Merge branch 'master' of github.com:adambard/learnxinyminutes-docs
Diffstat (limited to 'erlang.html.markdown')
-rw-r--r--erlang.html.markdown14
1 files changed, 7 insertions, 7 deletions
diff --git a/erlang.html.markdown b/erlang.html.markdown
index 64b62f05..04086aeb 100644
--- a/erlang.html.markdown
+++ b/erlang.html.markdown
@@ -260,22 +260,22 @@ spawn(F). % <0.44.0>
% For all of this to be useful we need to be able to receive messages. This is
% achieved with the `receive` mechanism:
--module(caculateGeometry).
+-module(calculateGeometry).
-compile(export_all).
-caculateAera() ->
+calculateArea() ->
receive
{rectangle, W, H} ->
W * H;
{circle, R} ->
3.14 * R * R;
_ ->
- io:format("We can only caculate area of rectangles or circles.")
+ io:format("We can only calculate area of rectangles or circles.")
end.
-% Compile the module and create a process that evaluates `caculateAera` in the shell
-c(caculateGeometry).
-CaculateAera = spawn(caculateGeometry, caculateAera, []).
-CaculateAera ! {circle, 2}. % 12.56000000000000049738
+% Compile the module and create a process that evaluates `calculateArea` in the shell
+c(calculateGeometry).
+CalculateArea = spawn(calculateGeometry, calculateArea, []).
+CalculateArea ! {circle, 2}. % 12.56000000000000049738
% The shell is also a process, you can use `self` to get the current pid
self(). % <0.41.0>