private (--)private creates a pending visibility specifier in the current scope.
That pending specifier is consumed by the next successful local creation. Intervening operations do not consume it.
A private name remains available for lookup inside its defining module, but it is not directly imported into another module.
private again is invalid.exportFunction, importFunction, and importVariable name creation.overload or virtual specifiers coexist with the pending private specifier.privateExample.mpl
private hidden: 1;
private overload virtual hiddenHelper: 3;
virtual visible: 2;
showHidden: [
"-- private name remains usable inside the module --" printCompilerMessage
hidden printStack _:;
];
test.mpl is the primary runnable example file.
test.mpl
"privateExample.visible" use
"privateExample.showHidden" use
{} 0 {} [
showHidden
"-- following created name is public again --" printCompilerMessage
visible printStack _:;
"-- private overload still participates after module load --" printCompilerMessage
hiddenHelper printStack _:;
0
] "main" exportFunction
Module-loading wrapper lines are omitted below.
-- private name remains usable inside the module --
Int32 Cref
-- following created name is public again --
2
-- private overload still participates after module load --
3
NAME: ...; node — Pushes a name onto the name stack and creates a local by consuming that name and one data-stack value.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; pending private applies there.importFunction builtin (inputsSchema output options name --) Declares or imports a named function with the supplied signature; pending private applies there.importVariable builtin (schema name --) Creates a local that refers to external variable storage; pending private applies there.overload builtin (--) Marks the next local created by NAME: ...; or def as participating in overload resolution.virtual builtin (--) Marks the next local created by NAME: ...; or def as static; virtual is the historical name for this declaration modifier.