# `Expression.V2.Callbacks`

Use this module to implement one's own callbacks.
The standard callbacks available are implemented in `Expression.V2.Callbacks.Standard`.

```elixir
defmodule MyCallbacks do
  use Expression.V2.Callbacks

  @doc """
  Roll a dice and randomly return a number between 1 and 6.
  """
  def dice_roll(ctx) do
    Enum.random(1..6)
  end

end
```

# `atom_function_name`

Convert a string function name into an atom meant to handle
that function

Reserved words such as `and`, `if`, and `or` are automatically suffixed
with an `_` underscore.

# `callback`

```elixir
@spec callback(
  module :: module(),
  context :: map(),
  function_name :: binary(),
  arguments :: [any()]
) :: any()
```

Callback a function while evaluating the context against an expression.

Callback functions in this module are either:

1. The function name as is
2. The function name with an underscore suffix if the function name is a reserved word
3. The function name suffixed with `_vargs` if the takes a variable set of arguments

# `implements`

```elixir
@spec implements(module(), function_name :: String.t(), arguments :: [any()]) ::
  {:exact, module(), function_name :: atom()}
  | {:vargs, module(), function_name :: atom()}
  | {:error, reason :: String.t()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
