Expression.Callbacks (expression v2.5.0)
The function callbacks for the standard function set available in FLOIP expressions.
This should be relatively swappable with another implementation.
The only requirement is the handle/3
function.
FLOIP functions are case insensitive. All functions in this callback module are implemented as lowercase names.
Some functions accept a variable amount of arguments. Elixir doesn't support variable arguments in functions.
If a function accepts a variable number of arguments the convention
is to call the <function_name>_vargs/2
callback where the context
is given as the first argument and the argument list as a second
argument.
Reserved names such as and
, if
, and or
are suffixed with an
underscore.
Link to this section Summary
Functions
Convert a string function name into an atom meant to handle that function
Handle a function call while evaluating the AST.
Link to this section Functions
atom_function_name(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.
handle(module \\ Standard, function_name, arguments, context)
@spec handle( module :: module(), function_name :: binary(), arguments :: [any()], context :: map() ) :: {:ok, any()} | {:error, :not_implemented}
Handle a function call while evaluating the AST.
Handlers in this module are either:
- The function name as is
- The function name with an underscore suffix if the function name is a reserved word
- The function name suffixed with
_vargs
if the takes a variable set of arguments