LoginSignup
10
1

More than 5 years have passed since last update.

Tips: Elixirは関数の引数にmoduleを渡すことができる

Last updated at Posted at 2019-01-21

Elixirの関数の引数にはmoduleを渡すことができる。

defmodule Test do
  def exec(m) do
    m.puts("hello")
  end
end

Test.exec(IO) #=> hello

実演

調べても、関数の引数におけるmoduleの扱いについてはあまり言及されていなかったのでメモ。

10
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
1