Skip to content

Variables Reference

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

Variables: Reference <<'name'>>

Reference variables establish a dependency to a matching object without overwriting the variable. This means following references will still refer to the original object, not to the one matched here.

Syntax

<< 'name' >>

Example

class C1 ( ) {
  let hhh ;

  function F1 ( ) {
    let aaa = hhh;
    let bbb = hhh;
  }
}

With reference variable <<'name'>>

<:let:> let <<name>> <| = <<'name'>> <||> |> ; <:>

The <<'name'>> creates a dependency to the matching hhh object but does not overwrite the name variable. Later references to name still resolve to the original binding.

Compared to standard variable <<name>>

<:let:> let <<name>> <| = <<name>> <||> |> ; <:>

With a standard <<name>>, the variable is overwritten, so subsequent references resolve to the new object.



In Practice

The Basics grammar uses <<'name'>> in two objects:

Object Usage Effect
variable let <<NAME>> <? = <<'name'>> ?> let xxx = zzz - creates a dependency from xxx to zzz without overwriting the variable
refference <<'name'>> . <<![class|function]name!>> C1.F1(aaa) - 'C1' creates a dependency to class C1, 'aaa' creates a dependency to variable aaa

In testFile.txt, let xxx = zzz inside function F1 creates a dependency to variable zzz in the parent class C1. Because <<'name'>> is used (not <<name>>), the name variable is not overwritten - later references still resolve correctly.

See Repo Analysis - Variable Resolution for the full resolution chain.


See also: Path Variables · Uppercase Variables · All Variables

Clone this wiki locally