edubkendo
9/26/2014 - 2:59 AM

a stack in elixir

a stack in elixir

defmodule Stack.Server do
  use GenServer

  def handle_call(:pop, _from, stack) do
    [ head | tail] = stack
    { :reply, head, tail }
  end
end