H (Hybrid) Language - v0.03, by Dr. Herong Yang
What Is a Variable
This section describes what is a variable in H language.
A variable is a symbolic name that refers to a specific data object stored somewhere in the computer memory at any given moment.
The lifecycle of a variable can be managed by the following program execution events:
1. Assigning a data object to a new variable:
x = 1; # x is defined as a new variable, referring to data object "1"
2. Assigning a different data object to an old variable:
x = 1; x = "Hello!"; # x is referring to data object "Hello!" now.
3. Updating value of the data object referenced by an old variable.
x = 1; x = "Hello!"; x[5] = "?"; # x is referring to data object "Hello?" now
4. Removing the reference of an old variable.
x = 1; x = "Hello!"; x[5] = "?"; x = $null; # x is referring to nowhere now
4. Deleting an old variable from the execution environment.
x = 1; x = "Hello!"; x[5] = "?"; x = $null; $delete x; # x is no longer available
Table of Contents
Inheritance - Object Attachments