@bitcapulet Purpose To get you excited about Elixir. So you’ll be more powerful. So your companies will start using it. So my friends and I have more Elixir jobs available. 5
@bitcapulet Purpose To get you excited about Elixir. So you’ll be more powerful. So your companies will start using it. So my friends and I have more Elixir jobs available. Because I'm excited about Elixir. 6
@bitcapulet Rob those phone companies blind! 16 years of searching and building. THEN 20 years of open-source improvements. 29 Now a fresh new language built on top!
@bitcapulet def get_name(map) do %{name: var} map var end get_name(%{}) ** (MatchError) no match of right hand side value: %{} 125 Not just for getting values!
@bitcapulet defmodule MyModule def phil(state) do receive do value -> IO.puts("count: " <> state) IO.puts("Phil got: " <> value) end phil(state + 1) end end 205
@bitcapulet defmodule Phil do use GenServer def init(_args), do: 0 def handle_cast(value, from, state) do IO.puts("Phil got: " <> value) {:noreply, state + 1} end end 264
@bitcapulet defmodule Phil do use GenServer def init(_args), do: 0 def handle_cast(value, from, state) do IO.puts("Phil got: " <> value) {:noreply, state + 1} end end 265
@bitcapulet defmodule Phil do use GenServer def init(_args), do: 0 def handle_cast(value, from, state) do IO.puts("Phil got: " <> value) {:noreply, state + 1} end end 266
@bitcapulet defmodule Phil do use GenServer def init(_args), do: 0 def handle_cast(value, from, state) do IO.puts("Phil got: " <> value) {:noreply, state + 1} end end 267
@bitcapulet defmodule Phil do use GenServer def init(_args), do: 0 def handle_cast(value, from, state) do IO.puts("Phil got: " <> value) {:noreply, state + 1} end def handle_call(:say_something, from, state) do {:reply, "something", state} end end 268
@bitcapulet GenServer.start_link(Phil, "arg", name: :phil) GenServer.cast(:phil, "a present with your name on it") pid = Process.whereis(:phil) Fee pid Registry 275
@bitcapulet defmodule CaptJoan do use Supervisor def init(_args) do children = [ {Phil, []} ] Supervisor.init(children, strategy: :one_for_one) end end 278
@bitcapulet defmodule CaptJoan do use Supervisor def init(_args) do children = [ {Phil, []} ] Supervisor.init(children, strategy: :one_for_one) end end 279
@bitcapulet defmodule CaptJoan do use Supervisor def init(_args) do children = [ {Phil, []} ] Supervisor.init(children, strategy: :one_for_one) end end 280
@bitcapulet defmodule CaptJoan do use Supervisor def init(_args) do children = [ {Phil, []}, {Phil, []}, {Phil, []} ] Supervisor.init(children, strategy: :one_for_one) end end 281
@bitcapulet defmodule CaptJoan do use Supervisor def init(_args) do children = [ {Phil, []}, {Phil, []}, {Phil, []} ] Supervisor.init(children, strategy: :one_for_one) end end 282
@bitcapulet defmodule CaptJoan do use Supervisor def init(_args) do children = [ {Phil, []}, {Phil, []}, {Phil, ["arg"]} ] Supervisor.init(children, strategy: :one_for_one) end end 286
@bitcapulet defmodule CaptJoan do use Supervisor def init(_args) do children = [ {Phil, []}, {Phil, []}, {Phil, ["arg"]} ] Supervisor.init(children, strategy: :one_for_all) end end 287
@bitcapulet defmodule AdmiralRavi do use Supervisor def init(_args) do children = [ {CaptJoan, []}, {CaptJoan, []}, {CaptJoan, []} ] Supervisor.init(children, strategy: :one_for_one) end end 288
@bitcapulet defmodule AdmiralRavi do use Supervisor def init(_args) do children = [ {CaptJoan, []}, {CaptJoan, []}, {CaptJoan, []} ] Supervisor.init(children, strategy: :one_for_one) end end 307
@bitcapulet capt = :kirk {:ok, message} = fav_capt(capt) IO.puts(message) ** (MatchError) no match of right hand side value: {:error, "Are you kidding me?"} 317