I noticed that in elixir version 0.10.1, you send a message to a process like this
my_process <- :message, self
But now in elixir 1.0.2, you send a message to a process like this
Process.send my_process, :message, self
What was the reason for this change?
Prior to this change, list comprehensions looked like this:
lc x inlist my_list do
# ...
end
However, the syntax was strange for newcomers and so the Elixir team set out to find an alternative. The winning syntax was
for x <- my_list do
# ...
end
Now, the meaning of <-
suddenly became dependent on the context. This is not generally a bad thing, but it is often harder to parse and may allow for ambiguities, so they decided to change it.
Another reason to use send
instead of <-
is to be consistent with the receive
syntax. It makes much more sense to let these two have a similar visual appearance than handling them on different syntactic levels.
By the way, your usage of Process.send/3
is wrong. The third parameter must be :noconnect
or :nosuspend
. Typically you would use the simpler and shorter send
(aka Kernel.send
) instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With