ϚΫϩల։࣌ʹ࣮ߦ͞ΕΔ quote do Mod1.func1 # ίϯύΠϧ࣌ʹ࣮ߦ͞ΕΔ(defmoduleͰల։͞ΕΔͨΊ) def unquote(name)() do # unquote(name)ϚΫϩల։࣌ʹ࣮ߦ͞ΕΔ IO.puts "#{unquote(name)} called." # IO.putsϥϯλΠϜɻunquote(name)ϚΫϩల։࣌ Mod1.macro2 # ίϯύΠϧ࣌ʹల։͞ΕΔ end end end defmacro macro2 do quote do IO.puts "macro2 called." # ϥϯλΠϜ(defͷதʹల։͞ΕΔͨΊ) end end def func1 do IO.puts "func1 called." end end defmodule Mod2 do import Mod1 macro1 :hello end # => macro1 called. # => func1 called. Mod2.hello # => hello called. # => macro2 called.