Skip to content

Variables Global

Benedict Albrecht edited this page Jun 2, 2026 · 3 revisions

Variables: :global Scope

The :global scope makes a variable visible for the entire file, and therefore also visible for any file that references this file.

Syntax

<< name:global >>

Example

class C1 ( ) {
  aaa();
  {
    aaa();
    aaa();
  }
  aaa();
}

With :global scope

<:sub:> { <-ref,sub-> } <:>
<:ref:>  <<name:global>> ( ) ; <:>

The aaa variable is visible everywhere in the file - to all siblings, upstream, downstream, and in any file that references this file.

Compared to default (:following)

<:sub:> { <-ref,sub-> } <:>
<:ref:>  <<name>> ( ) ; <:>

With default scope, aaa would only be visible to younger siblings and their downstream.


See also: :following · :up · :down · :siblings · :hook

Clone this wiki locally