static

static (--)

Inputs

Outputs

static is reserved and may appear in MPL source, but it has no documented standalone effect.

This builtin does not request static storage for the next created local.

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.

This entry exists because the word static names a storage property in MPL documentation and diagnostics even though the builtin itself has no standalone effect.

Behavior

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