Methods (methods v0.1.0)
Documentation for Methods
.
This adds method calls for Elixir structs.
Call methods with "..".
This breaks ranges if the second argument is a function call.
defmodule Rect do defstruct [width: 0, height: 0]
def area(self) do
self.width * self.height
end end
defmodule Main do use Methods
def main do
r1 = %Rect{width: 10, height: 10}
area = r1..area()
end end