Skip to content

Variables Following

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

Variables: :following Scope (Default)

The :following scope is the default scope for variables. It makes the variable visible for all younger siblings and downstream elements, including its own downstream. Resolution follows hierarchical order: new overwrites old.

Syntax

<< name:following >>
<< name >>          (equivalent - :following is the default)

Example

class C1 ( ) {
  let xxx ;
  let yyy ;

  {
    let zzz = xxx;
    let xxx = yyy;
  }

  let yyy = xxx;
}

Definition

<:{}:> { <-let-> } <:>
<:let:> let <<name>> <| = <<'name'>> <||> |> ; <:>

Resolution Behavior

  • zzz = xxx → resolves to the first xxx (the older sibling at the parent level)
  • xxx = yyy → resolves to the first yyy (visible from above)
  • yyy = xxx → resolves to the first xxx (the one at the same level - the inner xxx is not visible outside its block)

Variables with :following scope are visible to younger siblings and their downstream, following the hierarchical order.


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

Clone this wiki locally