Current section
Files
Jump to
Current section
Files
lib/playground.ex
defmodule Playground do
import Definject
definject hello(who, opts \\ [])
definject hello(name_list, _opts) when is_list(name_list),
do: name_list |> Enum.map(&"Hello, #{&1}")
definject hello(name, _opts) when is_binary(name), do: "Hello, #{name}"
# def hello(who, opts \\ [])
# def hello(name_list, _opts) when is_list(name_list), do: name_list |> Enum.map(&"Hello, #{&1}")
# def hello(name, _opts) when is_binary(name), do: "Hello, #{name}"
# def hello(who, opts \\ []), nil
# def hello(name_list, _opts) when is_list(name_list) do
# name_list |> Enum.map(&"Hello, #{&1}")
# end
# def hello(name, _opts) when is_binary(name) do
# "Hello, #{name}"
# {:def, [context: Elixir, import: Kernel],
# [
# {:hello, [context: Elixir], [{:who, [], Elixir}, {:\\, [], [{:opts, [], Elixir}, []]}]},
# []
# ]}
# {:def, [context: Elixir, import: Kernel],
# [
# {:hello, [context: Elixir], [{:who, [], Elixir}, {:\\, [], [{:opts, [], Elixir}, []]}]}
# ]}
# end
end