Skip to content

Variables Up

Benedict Albrecht edited this page May 20, 2026 · 4 revisions

Variables: :up Scope

The :up scope makes a variable visible for all siblings and their (including the object's) downstream elements, as well as their upper element. If the upper element is a file, it is visible for file references.

Syntax

<< name:up >>

Example

class C1 ( ) {
  F2() ;

  function F1 ( ) {
    F2();
  }

  function F2 ( ) {
    F2();
  }
}

With :up scope

<:function:> function <<name:up>> ( ) { <---> } <:>
<:ref:> <<'name'>> ( ) ; <:>

F2 is visible to:

  • The parent scope (F2() at the top of C1)
  • All sibling objects (F1 can call F2())
  • Its own downstream (recursive call within F2)

Compared to default (:following)

<:function:> function <<name>> ( ) { <---> } <:>
<:ref:> <<'name'>> ( ) ; <:>

With default scope, F2 would only be visible to younger siblings and their downstream — it would not be visible to F1 (an older sibling) or the parent scope above it.

Clone this wiki locally