Lets you define multiple heads for the same function:
defmodule Test do
import MultiDef
mdef fred do { :init, val } -> fred {:double, val} { :double, val } -> IO.puts(val*2) a, b -> a+b end end
IO.inspect Test.fred 1, 2 ...
Show All Activities