10.8. A module required after the walk, and calls into its macro context

The CROSS_CONTEXT module requires a shared module after the prerequisite walk - from a macro, a simulate macro or an [init], never from a running script, which has no compile for the module to join - and calls into its macro context by function name, so a module that is expensive to bring up and only sometimes needed comes in at the point that decides it needs it.

The function reached by name is [export]ed - a macro context keeps only exported, [init], [finalize] and macro-init functions - and it runs under the target context’s lock, so it must not call back into the calling context; everything the caller needs comes back through the result pointer.

All functions and symbols are in “cross_context” module, use require to get access to it.

require daslib/cross_context

10.8.1. Late require

macro_context_of(name: string ): Context?

The macro context of the shared module name, required now when the process lacks it; null, logged, when the module has no macros.

Arguments:
  • name : string

require_module_now(name: string ): Module?

Compiles name - a shared module - and its prerequisites now, under the compiling program’s policies and file access, or answers the one already in the process; a panic outside a compile (a macro, a simulate macro, an [init]). Null, logged, on failure.

Arguments:
  • name : string