H (Hybrid) Language - v0.03, by Dr. Herong Yang
Assignment Statement
This section describes what is an assignment statement in H language.
An assignment statement is a statement that assigns data objects to variables or reference holders with the following syntax:
variable = object; array[i] = object; hash[name] = object;
Examples of assignment statements are:
s = "Hello"; # assigns a string object to a variable a = array(); # assigns an array object to a variable a[0] <- "Hello"; # assigns a string object to reference holder h = hash(); # assigns a hash object to a variable h["message"] <- "Hello"; # assigns a string object to reference holder
The equal sign "=" is actually an alias of the keyword $refers. So assignment statements actually have the follow syntax:
variable $refers object; array[i] $refers object; hash[name] $refers object;
Design options:
1. Use the equal sign "=" to identify an assignment statement:
x = 1;
2. Use "<-" to identify an assignment statement:
x <- 1;
Table of Contents
Conditional "elseif" Statement
"switch" Statement - Not Supported
"do...while" Statement - Not Supported
Inheritance - Object Attachments