EEP 37: Funs with names

This adds optional names to fun expressions. A named fun expression
is parsed as a tuple `{named_fun,Loc,Name,Clauses}` in erl_parse.

If a fun expression has a name, it must be present and be the same in
every of its clauses. The function name shadows the environment of the
expression shadowing the environment and it is shadowed by the
environment of the clauses' arguments. An unused function name triggers
a warning unless it is prefixed by _, just as every variable.
Variable _ is allowed as a function name.

It is not an error to put a named function in a record field default
value.

When transforming to Core Erlang, the named fun Fun is changed into
the following expression:

    letrec 'Fun'/Arity =
               fun (Args) ->
                       let <Fun> = 'Fun'/Arity
                       in Case
    in 'Fun'/Arity

where Args is the list of arguments of 'Fun'/Arity and Case the
Core Erlang expression corresponding to the clauses of Fun.

This transformation allows us to entirely skip any k_var to k_local
transformation in the fun's clauses bodies.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# Not currently on any branch.
# You are currently editing a commit during a rebase.
#
# Changes to be committed:
#   (use "git reset HEAD^1 <file>..." to unstage)
#
#	modified:   lib/compiler/src/sys_expand_pmod.erl
#	modified:   lib/compiler/src/sys_pre_expand.erl
#	modified:   lib/compiler/src/v3_core.erl
#	modified:   lib/stdlib/examples/erl_id_trans.erl
#	modified:   lib/stdlib/src/epp.erl
#	modified:   lib/stdlib/src/erl_expand_records.erl
#	modified:   lib/stdlib/src/erl_lint.erl
#	modified:   lib/stdlib/src/erl_parse.yrl
#	modified:   lib/stdlib/src/erl_pp.erl
#	modified:   lib/stdlib/src/ms_transform.erl
#	modified:   lib/stdlib/src/qlc_pt.erl
#	modified:   lib/syntax_tools/src/erl_syntax.erl
#	modified:   lib/tools/src/cover.erl
#	modified:   lib/tools/src/xref_reader.erl
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	.otp.plt
#	bench_map.E
#	bench_map.P
#	bench_map.S
#	bench_map.abstr
#	bench_map.erl
#	bench_map.kernel
#	bench_map.pp
#	blah.erl
#	fact.S
#	fact.dis
#	fact.erl
#	fact.kernel
#	fact.life
#	foo.erl
#	lib/appmon/otp-eep37/
#	lib/asn1/otp-eep37/
#	lib/common_test/otp-eep37/
#	lib/compiler/otp-eep37/
#	lib/compiler/test/inline_SUITE.S
#	lib/compiler/test/inline_SUITE.core
#	lib/debugger/otp-eep37/
#	lib/erl_interface/otp-eep37/
#	lib/gs/contribs/otp-eep37/
#	lib/gs/otp-eep37/
#	lib/ic/examples/otp-eep37/
#	lib/ic/java_src/com/ericsson/otp/otp-eep37/
#	lib/ic/otp-eep37/
#	lib/inets/examples/otp-eep37/
#	lib/inets/otp-eep37/
#	lib/inets/src/otp-eep37/
#	lib/jinterface/java_src/com/ericsson/otp/otp-eep37/
#	lib/kernel/otp-eep37/
#	lib/mnesia/otp-eep37/
#	lib/otp_mibs/otp-eep37/
#	lib/reltool/otp-eep37/
#	lib/runtime_tools/otp-eep37/
#	lib/sasl/otp-eep37/
#	lib/snmp/examples/otp-eep37/
#	lib/snmp/otp-eep37/
#	lib/snmp/priv/conf/otp-eep37/
#	lib/snmp/src/otp-eep37/
#	lib/stdlib/doc/src/erl_parse.erl
#	lib/stdlib/otp-eep37/
#	lib/stdlib/test/erl_lint_SUITE_priv/
#	lib/stdlib/test/erl_pp_test.E
#	lib/stdlib/test/erl_pp_test.erl
#	lib/test_server/otp-eep37/
#	lib/tools/otp-eep37/
#	lib/wx/examples/otp-eep37/
#	lib/wx/otp-eep37/
#	rcomp.S
#	rcomp.erl
Update primary bootstrap for named funs
Support named funs in the shell
Update primary bootstrap for named funs in the shell
Support named funs in the debugger interpreter
Test named funs
Document named fun expressions