View Source ExKits.Macros.Constants (ex_kits v0.2.7)

This module provides a macro for defining compile-time constants in Elixir code.

Examples


# Define a constant:
defmodule MyConst do
  import ExKits.Macros.Constants

  const :pi, 3.14159
end

# Use a constant:

require MyConst
@pi MyConst.pi()

IO.puts(@pi)

Summary

Functions

Link to this macro

const(const_name, const_value)

View Source (macro)