Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

function '<-'/2 undefined Error in receive block Elixir

Tags:

elixir

This is my Elixir code.

defmodule ErlProcess do
    def receiver do
        receive do
            {:sayHello, msg}->sender<-{:ok, "ok"}
        end
    end
end

But it gives this error.

** (CompileError) spawn.exs:4: function '<-'/2 undefined
    (stdlib) lists.erl:1323: :lists.foreach/2
    (stdlib) erl_eval.erl:569: :erl_eval.do_apply/6
    (elixir) src/elixir.erl:140: :elixir.eval_forms/4
    (elixir) src/elixir_lexical.erl:17: :elixir_lexical.run/2

How to fix this?

like image 864
Lahiru Avatar asked Mar 23 '14 05:03

Lahiru


1 Answers

pid <- msg was removed, please send pid, msg instead.

like image 73
José Valim Avatar answered Sep 30 '22 15:09

José Valim