One key use of process expansion, used in currently-shipped code, is for running a function on
current shell exit.
Restore the use of %self as a valid argument (and add `self`) and document this change.
(faho: Remove bare "self")
The idea is that we can return the shared pointer directly, avoiding
lots of annoying little getter functions that each need to take locks.
It also helps to pull together the data structures used to initialize
functions versus store them.
Prior to this fix, functions stored a string representation of their
contents. Switch them to storing a parsed source reference and the
tnode of the contents. This is part of an effort to avoid reparsing
a function's contents every time it executes.
This does several things. It fixes `builtin_function()` so that errors it
emits are displayed. As part of doing that I've removed the unnecessary
`out_err` parameter to make the interface like every other builtin.
This also fixes a regression introduced by #4000 which was attempting to
fix a bug introduced by #3649.
Fixes#4139
Running the tests on travis revealed that some compilers (or at least
with some options) call the wrong struct constructor if there is more
than one struct with the same name but differing definitions.