-
Notifications
You must be signed in to change notification settings - Fork 0
Variables Reference
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.
<< 'name' >>
class C1 ( ) {
let hhh ;
function F1 ( ) {
let aaa = hhh;
let bbb = hhh;
}
}<: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.
<:let:> let <<name>> <| = <<name>> <||> |> ; <:>
With a standard <<name>>, the variable is overwritten, so subsequent references resolve to the new object.
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
- Getting Started
- Sign-Up
- Home Screen
- Creating Your First Template
- Template Editor
- Application Navigation
- Syntax Overview
- Workflow: End-to-End
- Workflow: Test with simpleDemo
- Workflow: Build Template from angularTemp
- Demo Repositories
- Template
- Workbench
- GitHub Integration
- GitHub App Installation
- GitHub Repository Setup
- GitHub Re-linking
- Settings
- Overview
- Declarations
- Types
- Scoping