Issue 4462/1: Create a module variable access system for C++
This replaces the previous "memoizing" ly_lily_module_constant with a
rather rigid system for importing/exporting/accessing module variables.
As opposed to the system used by ly_lily_module_constant, access will
continue to go through the respective module variables, making it
possible to also write to the respective variables. In addition, this
ensures that any changes to the variables from the Scheme side will get
properly reflected in the C++ side, allowing for redefinitions when
debugging.
In a nutshell, ly_lily_module_constant ("ly:music?") would generally be
replaced with Lily::ly_music_p, a declaration of it looking like
extern Variable ly_music_p;
would be placed in namespace Lily in lily/include/lily-imports.hh, and a
corresponding definition
Variable ly_music_p ("ly:music?");
in namespace Lily in lily/lily-imports.cc . The type Scm_module where
variables are organized can use pre-existing modules (in which case it
is initialized by calling the member function import ()) or are can
bring up a fresh module (in which case it is initialized by calling the
member function boot ()). The startup is done in lily/guile-init.cc .
Since one of the most frequent uses of imported variables is for
function calls, the Scm_variable type (underlying the module-local
Variable type) has operator () defined to allow calling as a function.