diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-04-30 19:01:47 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-04-30 19:01:47 +0300 |
commit | fddd6110e00df12c99a20a2cc9d074f5f4f1f965 (patch) | |
tree | 366575b855f1b2013db7eeb02ecb213f81c98c1f /src/misc.erl | |
parent | 2b63d07329b2af63d63b14d237e63565f78e8018 (diff) |
Don't validate an option in gen_mod:get*opt() functions
The changes are very similar to those from previous commit:
* Now there is no need to pass validating function in
gen_mod:get_opt() and gen_mod:get_module_opt() functions,
because the modules' configuration keeps already validated values.
* New functions gen_mod:get_opt/2 and gen_mod:get_module_opt/3 are
introduced.
* Functions gen_mod:get_opt/4 and get_module_opt/5 are deprecated.
If the functions are still called, the "function" argument is
simply ignored.
* Validating callback Mod:listen_opt_type/1 is introduced to validate
listening options at startup.
Diffstat (limited to 'src/misc.erl')
-rw-r--r-- | src/misc.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/misc.erl b/src/misc.erl index 99612b77d..dae95c6d5 100644 --- a/src/misc.erl +++ b/src/misc.erl @@ -33,7 +33,7 @@ hex_to_bin/1, hex_to_base64/1, expand_keyword/3, atom_to_binary/1, binary_to_atom/1, tuple_to_binary/1, l2i/1, i2l/1, i2l/2, expr_to_term/1, term_to_expr/1, - encode_pid/1, decode_pid/2, compile_exprs/2]). + encode_pid/1, decode_pid/2, compile_exprs/2, join_atoms/2]). %%%=================================================================== %%% API @@ -237,6 +237,10 @@ compile_exprs(Mod, Exprs) -> {error, compile_failed} end. +-spec join_atoms([atom()], binary()) -> binary(). +join_atoms(Atoms, Sep) -> + str:join([io_lib:format("~p", [A]) || A <- Atoms], Sep). + %%%=================================================================== %%% Internal functions %%%=================================================================== |