importVariable (schema name --)schema: Value or Ref whose dereferenced schema becomes the schema of the imported variable.name: Known external and local name Text.schema supplies only the imported local's schema. Its current value is not imported.
The builtin creates a new local named exactly name in the current scope. That local refers to external variable storage of the selected schema.
After creation, the imported name participates in normal local lookup. Bare mention, @NAME, and !NAME therefore follow the normal MPL rules for a local of the selected schema.
This builtin declares an external variable name only. It does not create a local from an existing stack value, and it does not declare an external callable name.
name must be known Text.name text becomes both the external variable name and the created local name. Separate renaming is not provided here.schema supplies only the imported local's schema; its current value is not imported.importVariable with the same name creates another local of that name; normal newest-to-oldest lookup then selects the latest one.private modifier applies to the created imported name.overload and virtual modifiers are invalid here.A fully runnable positive example also requires a separately defined external variable of the requested schema. This page therefore records the creation and lookup rules instead of a standalone executable example.
NAME: ...; node — Pushes a name onto the name stack and creates a local by consuming that name and one data-stack value.codeRef builtin (inputsSchema output options -- code) Constructs a Code schema and pushes a known NIL Code value of that schema.def builtin (value name --) Creates a named local or field using a known Text name.exportFunction builtin (inputsSchema output options callable name --) Exports a named function built from a Block and a signature.importFunction builtin (inputsSchema output options name --) Declares or imports a named function with the supplied signature and binds it in the current scope as a Code local.use builtin (moduleDescriptor --) Imports public names from a module path named by known Text, or imports one selected public name when the last dot after the last path separator separates the module path from that name.