summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNami-Doc <vendethiel@hotmail.fr>2014-05-20 09:30:40 +0200
committerNami-Doc <vendethiel@hotmail.fr>2014-05-20 09:30:40 +0200
commit3da1896a2ecda7f339b16d84f0653de25ac1fd0b (patch)
tree0375d66f81a5286d7331f530db5e34f5c645e970
parent703f15b91ba874ec68f013b6884718af37cfa330 (diff)
parent0d6b7513c79bee6daf131d4437bf1319559fb6f4 (diff)
Merge pull request #617 from jveiga/correct_elixir_message_sending
Elixir - Remove deprecated <- operator in favor of send
-rw-r--r--elixir.html.markdown6
1 files changed, 3 insertions, 3 deletions
diff --git a/elixir.html.markdown b/elixir.html.markdown
index 0892deb7..b27b2ee8 100644
--- a/elixir.html.markdown
+++ b/elixir.html.markdown
@@ -358,7 +358,7 @@ f = fn -> 2 * 2 end #=> #Function<erl_eval.20.80484245>
spawn(f) #=> #PID<0.40.0>
# `spawn` returns a pid (process identifier), you can use this pid to send
-# messages to the process. To do message passing we use the `<-` operator.
+# messages to the process. To do message passing we use the `send` operator.
# For all of this to be useful we need to be able to receive messages. This is
# achived with the `receive` mechanism:
defmodule Geometry do
@@ -378,11 +378,11 @@ end
pid = spawn(fn -> Geometry.area_loop() end) #=> #PID<0.40.0>
# Send a message to `pid` that will match a pattern in the receive statement
-pid <- {:rectangle, 2, 3}
+send pid, {:rectangle, 2, 3}
#=> Area = 6
# {:rectangle,2,3}
-pid <- {:circle, 2}
+send pid, {:circle, 2}
#=> Area = 12.56000000000000049738
# {:circle,2}