Module triq_expr

Function Index

eval/1Evaluate Body.
eval/2Evaluate Body, replacing occurrences of {call,M,F,A} and {var,N}.
free_vars/1

Function Details

eval/1

eval(Body::any()) -> any()

Equivalent to eval([], Body).

Evaluate Body. Occurrences of {call,M,F,A} is replaced by the result of calling erlang:apply(M,F,A), and occurrences of {var,Name} in Body are not substituted.

This is a plain function, not a compile_transform or anything like that, so nested functions are not traversed in the substitution. However, nested occurrences of {call,M,F,A} are substituted as one would think: depth first, left-to-right.

eval/2

eval(PropList::[{atom(), any()}], Body::any()) -> any()

Evaluate Body, replacing occurrences of {call,M,F,A} and {var,N}. Occurrences of {call,M,F,A} is replaced by erlang:apply(M,F,A), and {var,Name} is replaced by the value with key Name in PropList.

Exceptions happening when calling erlang:apply/3 are not caught. If Name is unbound i.e., Name does not appear in PropList or if Name is not an atom, {var,Name} is unchanged.

This is a plain function, not a compile_transform or anything like that, so nested functions are not traversed in the substitution. However, nested occurrences of {call,M,F,A} are substituted as one would think: depth first, left-to-right.

free_vars/1

free_vars(T) -> any()


Generated by EDoc, Mar 29 2016, 02:06:24.