H (Hybrid) Language - v0.03, by Dr. Herong Yang
Execution of $class Definition Body
This section describes when the $class definition body is executed.
When the $class statement is executed, the $class definition body will be executed. This is how class variables get their default values assigned.
Example showing the execution of $class definition body:
$class circle: { write("Adding class variables..."); pi = 3.14159; $function area(radius): { return ^.pi*radius**2; }; $function circumference(radius): { return ^.pi*radius*2; } } # you see the "Adding class variables..." message displayed
Table of Contents
$class Statement - Create New Classes
►Execution of $class Definition Body
__new() - Object Constructor Function
$instance Statement - Define Instance Template
Execution of $instance Definition Body
$method Statement - Define Object Method
_first() Method - Object Initialization
Access Class Variables from Object Methods
__delete() - Object Destructor Method
$delete Statement - Delete Objects
_last() Method - Object Cleanup
Inheritance - Object Attachments