* module/ice-9/boot-9.scm (module-public-interface)
(set-module-public-interface!): Instead of using
'%module-public-interface, use a field in the module instead.
(make-module, make-autoload-interface): Adapt.
* module/ice-9/deprecated.scm (module-public-interface):
(set-module-public-interface!): Add shims so that manually munging
%module-public-interface should continue to work.
* libguile/modules.c: Consolidate all variables to the top of the file.
(scm_module_public_interface): Dispatch to Scheme.
(scm_post_boot_init_modules): Resolve module-public-interface.
* module/ice-9/boot-9.scm (module-public-interface): Implement in
Scheme.
* module/ice-9/boot-9.scm (module-submodule-binder)
(set-module-submodule-binder!): New field on modules.
(make-module, make-autoload-interface): Adapt.
(module-ref-submodule): If we miss the submodules table, call the
submodules binder, if any.
* module/ice-9/deprecated.scm (module-ref-submodule): Check the
submodule binder before the deprecated look into the obarray.
* module/ice-9/boot-9.scm (module-ref-submodule)
(module-define-submodule!): Implement in terms of the
module-submodules table, instead of looking for bindings in the value
namespace.
* module/ice-9/deprecated.scm (module-ref-submodule):
(module-define-submodule!): Define deprecated versions of these that
duplicate the submodules table in the normal values namespace, for
back compatibility.
* module/ice-9/boot-9.scm (module-type, module-constructor): Add a field
to modules, a table that will hold submodules.
(make-module, make-autoload-interface): Adapt.
* module/ice-9/ls.scm (local-definitions-in, definitions-in): Use nested
module procedures, as appropriate.
(recursive-local-define): Fix attempt to treat null as false. Whoops..
* module/ice-9/deprecated.scm (%app, app, modules): Don't use the module
interface to provide %app shims, use module-define-submodule! directly
to side-effect the root module.
* module/ice-9/boot-9.scm (resolve-module): Use module-define-submodule!
when binding the root, and nested-ref-module for the hot lookup, which
is guaranteed to return a module or #f.
* module/ice-9/boot-9.scm (module-name): Use module-define-submodule!
instead of nested-define!.
(make-modules-in): Rewrite in terms of nested-define-module!.
* module/ice-9/boot-9.scm: Update comments above nested-ref to include
ref-module and define-module!.
(nested-ref, nested-set!, nested-define!, nested-remove!): Use
module-ref-submodule to traverse the module hierarchy.
(nested-ref-module, nested-define-module!): New functions, like
nested-ref and nested-define!, but operate on namespaces instead of
values.
(local-ref-module, local-define-module): New analogs of local-ref and
local-define, but for namespaces.
* module/ice-9/boot-9.scm (module-ref-submodule):
(module-define-submodule!): New stubs, will be used to separate
traversing the module tree from accessing values.
* module/ice-9/boot-9.scm (resolve-module): If we found a module but it
didn't have a public interface and we're not autoloading, just return
the module directly instead of dispatching to make-modules-in.
* module/ice-9/boot-9.scm (module-name): Don't rely on (%app modules),
use other tricks to name anonymous modules.
(resolve-module): Instead of relying on %app, close over the root of
the module hierarchy -- the module that was '(%app modules).
* module/ice-9/deprecated.scm (%app): Provide a compatible %app shim.
* module/ice-9/boot-9.scm (%app): Bind %app and (%app modules) within
the nested hierarchy before making (guile).
(the-root-module): Define to '(%app modules guile) together with
the-root-module's definition.
(resolve-module): Define a "phase 2" resolve-module that only works on the
root module.
(try-module-autoload): No need for stub definition, as modules.c does
not reference this binding.
(resolve-module): Redefine, after modules have been loaded, to
actually do its job, without any hacks for the pre-boot phase.
Move up the boot code before the definition of resolve-module's
helpers.
* module/ice-9/debugging/breakpoints.scm (module-if-already-loaded):
(all-loaded-modules):
* module/oop/goops/stklos.scm: Fix instances of (app modules) to be
(%app modules).
* module/ice-9/boot-9.scm (make-record-type): Add an explanatory
comment.
(%print-module): Remove a hacky comment about redefinitions being
difficult, because now the module-printer is called by name from
module-type's printer.
(module-type): Define the module type, its constructor, predicate, and
accessors programmatically, at expansion time. Should reduce any
errors in transcription, between adding fields and adding accessors.
* libguile/modules.c (scm_lookup_closure_module): Move an explanatory
comment here from boot-9.scm.
* module/ice-9/boot-9.scm (record-type-vtable): Add a third field, a
precomputed constructor. There is an unfortunate circularity here,
though.
(make-record-type): If the record has fewer than 20 fields,
return a constructor pre-generated to suit. Otherwise just check the
length, and dispatch to `apply' and not `primitive-eval'. FWIW the
current module record has something like 12 fields.
(record-constructor): If we're asking for the standard constructor,
return the precomputed constructor.
* test-suite/tests/records.test ("records"): Add tests for printers.
* module/ice-9/boot-9.scm (make-record-type): Refactor the code that
makes the default printer.
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (@bind): Deprecate @bind, which was a
thread-unsafe dynamic scoping mechanism, used in the old elisp
support. Fluids are more correct, and are probably faster, given the
VM support for with-fluids.
* test-suite/tests/dynamic-scope.test: Remove.
* test-suite/tests/fluids.test: Move relevant tests from
dynamic-scope.test here, recast in terms of with-fluids.
* module/system/base/compile.scm (compile-file, compile-and-load): Add a
keyword arg #:canonicalization, which defaults to 'relative. In this
way, one might compile "../module/ice-9/boot-9.scm", but the path that
gets residualized into the .go is "ice-9/boot-9.scm".
* libguile/procprop.h (scm_sym_arity): Deprecate. I didn't move it to
deprecated.h though, because that might have some boot implications --
though I didn't check.
* libguile/procprop.c (scm_procedure_properties)
(scm_set_procedure_properties_x, scm_procedure_property)
(scm_set_procedure_property_x): Deprecate access to a procedure's
arity via procedure-properties. Users should use
procedure-minimum-arity.
* module/ice-9/channel.scm (eval):
* module/ice-9/session.scm (arity):
* module/language/tree-il/analyze.scm (validate-arity): Fix up instances
of (procedure-property x 'arity) to use procedure-minimum-arity.
* libguile/programs.h:
* libguile/programs.c (scm_program_name): Remove. procedure-name is
sufficient.
* module/system/vm/program.scm (program-name): Remove from exports list.
(program-documentation): Remove; procedure-documentation is
sufficient.
* libguile/debug.c (scm_procedure_name): Remove special case for
programs.
* module/language/tree-il/analyze.scm (validate-arity): Use
procedure-name.
* module/ice-9/documentation.scm (object-documentation): Just use
procedure-documentation, without special cases for programs.
* libguile/programs.h:
* libguile/programs.c (scm_i_program_properties): Make internal.
(scm_program_name): Use scm_i_program_properties.
* libguile/procprop.c (scm_procedure_properties): Use
scm_i_program_properties, for programs.
* libguile/procs.c (scm_procedure_documentation): Use procedure-property
to get to 'documentation, not program-property.
* module/system/vm/program.scm (program-properties, program-property):
Remove from the exports list.
(program-documentation): Use procedure-property.
* module/texinfo/reflection.scm (macro-arguments)
(macro-additional-stexi)
(object-stexi-documentation): Use procedure-property, not
program-property.
* module/language/elisp/runtime/macro-slot.scm (or, and): Fix one-arg
case to return the arg as-is.
* module/language/elisp/runtime.scm (nil-value): Fix to be #nil.
* module/system/vm/debug.scm (*debug-input-port*):
(*debug-output-port*): New public fluids.
(run-debugger): Add some kwargs for input and output ports, defaulting
to the debug input and output ports.
(debug-pre-unwind-handler): Print to debug output port.
(debug): Untabify.
* module/ice-9/boot-9.scm (repl-reader): For the default (non-readline)
repl reader, only display the prompt if input isn't already available.
Fixes spurious prompts in the debugger.
* module/ice-9/boot-9.scm (module-use!, module-use-interfaces!): When
adding the module or interface to the use list, clear the cached
imports obarray.
The test case is coming next.
* module/language/ecmascript/tokenize.scm: Use `make-lexical-token' and
related procedures instead of pairs as tokens passed to the parser.
Pass source location information in the form of `source-location'
objects.
* module/language/ecmascript/parse.scm (read-ecmascript,
read-ecmascript/1): Instantiate a new parser at each call.
(parse-ecmascript): Rename to...
(make-parser): ... this. Change `->' to `:' in the grammar syntax.
* module/language/ecmascript/parse-lalr.scm: Remove.
* module/Makefile.am (ECMASCRIPT_LANG_SOURCES): Remove
`language/ecmascript/parse-lalr.scm'.
* module/texinfo/reflection.scm (macro-arguments):
(macro-additional-stexi, object-stexi-documentation): Parse out the
metadata in macros, if it is available, so we can show defmacros'
arguments, syntax-rules' patterns, etc.
* module/ice-9/psyntax.scm (syntax-rules, identifier-syntax):
* module/ice-9/boot-9.scm (define-macro): Embed metadata into the macro
transformer for use by documentation tools and the like.
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/language/tree-il/inline.scm (inline!): Only inline (lambda args
(apply (lambda ...) args)) if the outer lambda has rest args. Thanks
to Mark Weaver for the note.
* module/ice-9/psyntax.scm (chi-lambda-case, lambda): If we find a
vector of pairs in the docstring position, interpret those pairs as
additional metadata.
* module/ice-9/psytntax-pp.scm: Regenerated.