Skip to content

Instantly share code, notes, and snippets.

@shiro01
Created June 21, 2018 04:26
Show Gist options
  • Save shiro01/1da160e5ef33940d33cf4fc8269037e0 to your computer and use it in GitHub Desktop.
Save shiro01/1da160e5ef33940d33cf4fc8269037e0 to your computer and use it in GitHub Desktop.
elixir test code
defmodule TestCode do
def hello() do
a = [foo: "bar", hello: "world", hello: "test"]
m = %{:foo => "hoge", "hoge" => "bar"}
IO.inspect a
IO.inspect m[m.foo]
m2 = %{m | :foo => "hhhh"}
IO.inspect m.foo
IO.inspect m2.foo
enum_functions = Enum.__info__(:functions)
IO.inspect(enum_functions)
Enum.__info__(:functions) |> Enum.each(fn({function, arity}) -> IO.puts "#{function}/#{arity}" end)
end
end
TestCode.hello()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment