Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document the erlang:make_fun/3 BIF, so that tools that analyze Erlang code may depend on its behavior. By documenting the BIF, we implicitly promise not to remove it without prior deprecation at least one release before the removal. Before reaching the decision to document erlang:make_fun/3, I attempted to transform external funs to internal fun and back again in v3_kernel so that tools would not have to care, but I encountered the following issues: First I tried to translate all funs that looked something like: fun(A1, ... AN) -> M:F(A1, ... AN) end to external funs, but that transformation is not safe if M happens to be an instance of a parameterized module. My second attempt was to use a non-standard 'id' annotation in funs that started out as external funs, and transform those funs back to external funs in v3_kernel, but that failed because the inliner kills 'id' annotations. That problem could probably be solved by inventing another annotation, but now the solutions are becoming too complex for my taste. Also, there is always the risk that the inliner could surprise us with an optimization that would lose the annotation so that an external fun would become internal.
- Loading branch information