static (--)
Inputs
- None.
Outputs
- None.
static is reserved and may appear in MPL source, but it has no documented standalone effect.
It neither creates nor clears pending declaration modifiers. In particular, it does not set the pending static specifier used by virtual, and it does not affect pending overload or private specifiers.
Behavior
- The declaration modifier that marks the next created local as static is
virtual.
Example
{} 0 {} [
static static ordinaryLocal: 1;
virtual staticLocal: 2;
"-- static does not declare a static local --" printCompilerMessage
ordinaryLocal printStack _:;
"-- virtual does declare a static local --" printCompilerMessage
staticLocal printStack _:;
0
] "main" exportFunction
Expected Output During Compilation
-- static does not declare a static local --
1 Cref
-- virtual does declare a static local --
2
See also
code?builtin(schema -- isBlock)HistoricalBlock-schema test.codeRef?builtin(schema -- isCode)Code-schema test.fieldIsVirtualbuiltin(schema ordinal -- hasNoStorage)No-storage test for one selected item.virtualbuiltin(--)Historical static-declaration modifier for the next local.virtual?builtin(schema -- isMeta)Historical Meta-schema test.