type_of/1 | Determine the type of a term. |
validate_function/3 | Validate that Fun is a function of arity Arity . |
validate_module/2 | Validate that Module is an atom that names a loaded or
loadable module. |
type_of(Term::term()) -> pid | reference | list | tuple | atom | number | binary | function
Determine the type of a term. For example:
number = riak_pipe_v:type_of(1). atom = riak_pipe_v:type_of(a). pid = riak_pipe_v:type_of(self()). function = riak_pipe_v:type_of(fun() -> ok end).
validate_function(Label::string(), Arity::integer(), Fun::function() | {atom(), atom()}) -> ok | {error, iolist()}
Validate that Fun
is a function of arity Arity
.
If the function is of type local
(anonymous functions, and
functions named via fun Name/Arity
), validation completes
onces the arity is checked.
If the function is of type external
(functions named via
fun Module:Function/Arity
), then it is also verified that
the module is loaded or loadable (see validate_module/2
) and that it exports the named function.
ok
is
returned. If validation failes, an {error, Reason}
tuple is
returned. (Label
is used in the error message).
validate_module(Label::string(), Module::term()) -> ok | {error, iolist()}
Validate that Module
is an atom that names a loaded or
loadable module. If a module is already loaded under that
name, or code:load_file/1
is able to load one, the
atom ok
is returned. If no module is found, and {error,
Reason}
tuple is returned. (Label
is used in the error
message).
Generated by EDoc, Jan 11 2013, 18:45:59.