-
Notifications
You must be signed in to change notification settings - Fork 0
Variables Up
Benedict Albrecht edited this page Jun 2, 2026
·
4 revisions
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.
<< name:up >>
class C1 ( ) {
F2() ;
function F1 ( ) {
F2();
}
function F2 ( ) {
F2();
}
}<:function:> function <<name:up>> ( ) { <---> } <:>
<:ref:> <<'name'>> ( ) ; <:>
F2 is visible to:
- The parent scope (
F2()at the top ofC1) - All sibling objects (
F1can callF2()) - Its own downstream (recursive call within
F2)
<: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.
The Basics grammar uses :up on imports, classes, and functions:
| Declaration | Why :up? |
|---|---|
import <<name:up>> |
Imported name must be visible to sibling objects. In testFile.txt, C2 is imported and then used in C2.F3() and C2.F4(). |
class <<NAME:up>> |
Class name must be visible to siblings and the parent file. C1 is used by refference objects at file level. |
function <<NAME:up>> |
Function name visible to parent class. F1 and F2 are referenced via C1.F1() using dependency selection. |
Without :up, the refference objects at the bottom of testFile.txt would not be able to resolve C1, C2, F1, etc.
See Repo Analysis - Variable Resolution for the full resolution walkthrough.
See also:
:following·:down·:siblings·:global·:hook
- 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