Function shadowing
Unqualified functions shadow as stated previously. This results in the following order within a module, outermost to innermost:
- Predefined BIFs (same as in vanilla Erlang)
- Predefined LFE BIFs
- Imports
- Top-level defines
- Flet/fletrec
This means that it is perfectly legal to shadow BIFs by imports,
BIFs/imports by top-level functions and BIFs/imports/top-level by
fletrecs
. In this respect there is nothing special about BIfs, they
just behave as prefined imported functions, a whopping big (import
(from erlang ...))
. EXCEPT that we know about guard BIFs and
expression BIFs. If you want a private version of spawn
then define
it, there will be no warnings.
CAVEAT: This does not hold for the supported core forms. These can be shadowed by imports or redefined but the compiler will always use the core meaning and never an alternative. Silently!