optparse: replace getopt with an easier to use option parser.

* specs/optparse_spec.yaml: Specify behaviour for a civilised
option parsing API.
* lib/std/optparse.lua: New module.
* lib/std/getopt.lua: Remove.
* doc/config.ld (file), local.mk (dist_luastd_DATA): Adjust.
* specs/getopt_spec.yaml: Remove.
* local.mk (dist_modules_DATA, dist_classes_DATA): Adjust.
* specs/specs.mk (specl_SPECS): Likewise.
* build-aux/sanity-cfg.mk: New file.  Don't fail sanity checks on
account of 'OptionParser' in optparse.lua error message.
* NEWS: Update.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
maint: workaround a luarocks bug handling debug_init.lua.

LuaRocks misinstalls build.modules entries ending in `init.lua`,
so rearrange the source tree and Automake rules so that
`require "std.debug_init"` still works as before even though
the file ends up in the wrong directory after installation.
* lib/std/debug_init.lua: Move from here...
* lib/std/debug_init/init.lua: ...to here.
* slingshot: upgrade for `.../init.lua` handling in mkrockspecs.
* local.mk (dist_luastd_DATA): Remove lib/std/debug_init.lua.
(dist_luastddebug_DATA): New installation dir.  Add
lib/std/debug_init/init.lua.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
maint: cosmetic fix to imported module list.

* lib/std/modules.lua: Replace `getopt` with `optparse`.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
rockspecs: update detailed description text.

* rockspec.conf (description.detailed): Remove mention of regexps
and getopt.  Add mention of civilised option parsing.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
maint: plug symbol leaks with working specifications.

* specs/spec_helper.lua (show_apis): New function. Compare table
entries in a sub-process, to support tracking namespace changes
when requiring modules by various means.
* specs/functional_spec.yaml: New file.  Use it to ensure
"std.functional" doesn't leak symbols.
* specs/debug_spec.yaml, specs/functional_spec.yaml,
specs/io_spec.yaml, specs/list_spec.yaml, specs/math_spec.yaml,
specs/object_spec.yaml, specs/optparse_spec.yaml,
specs/package_spec.yaml, specs/set_spec.yaml,
specs/spec_helper.lua, specs/specs.mk, specs/strbuf_spec.yaml,
specs/string_spec.yaml, specs/table_spec.yaml,
specs/tree_spec.yaml: Rewrite specs that check symbol leaks
using show_apis().
* lib/std/base.lua (new): Don't forget the forward declaration.
* lib/std/set.lua (proper_subset): Likewise.
* NEWS: Update.
Reported by Dirk Laurie <dirk.laurie@gmail.com>

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
doc: add the package name and version to html doc page titles.

* doc/config.ld: Move from here...
* doc/config.ld.in: ...to here.  Add a title setting incorporating
@PACKAGE@ and @VERSION@.
* configure.ac (AC_CONFIG_FILES): Add doc/config.ld.
* .gitignore: Add doc/config.ld.
Suggested by Dirk Laurie <dirk.laurie@gmail.com>

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
std: lazy load submodules on demand.

* specs/std_spec.yaml: New specifications for lazy loading.
* specs/specs.mk (specl_SPECS): Add specs/std_spec.yaml.
* lib/std.lua.in (std.__index): Implement it.
* NEWS: Update.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>