Update page 'Aer v1.0 Specification'
@@ -206,8 +206,8 @@ Null is a special data type. Basically, the data type means non existent, not kn
|
||||
### 5.12. Arrays
|
||||
Array is a complex data type which handles a collection of elements. Each of the elements can be accessed by an index. In Aer, just like in PHP, arrays are more complex. An array in Aer is actually an ordered map. A map is a type that associates values to keys. This type is optimized for several different uses; it can be treated as an array, list (vector), hash table (an implementation of a map), dictionary, collection, stack, queue, and probably more.
|
||||
|
||||
int $arr1[];
|
||||
int $arr2[] = {0, 0}
|
||||
int[] $arr1;
|
||||
int[] $arr2 = {0, 0}
|
||||
$arr1 = {1, 2, 3, 4, 5};
|
||||
$arr1[] = 6;
|
||||
$arr1[] = {7};
|
||||
@@ -545,7 +545,7 @@ There are three widely used programming paradigms there: procedural programming,
|
||||
* Encapsulation
|
||||
* Inheritance
|
||||
|
||||
### 10.1. Objects in P\#
|
||||
### 10.1. Objects in AerScript
|
||||
Objects are basic building blocks of a Aer script. An object is a combination of data and methods. In a OOP program, we create objects. These objects communicate together through methods. Each object can receive messages, send messages, and process data. There are two steps in creating an object. First, a class needs to be defined. A class is a template for an object. It is a blueprint which describes the state and behavior that the objects of the class all share. A class can be used to create many objects. Objects created at runtime from a class are called instances of that particular class.
|
||||
|
||||
class Demo { }
|
||||
|
||||
Reference in New Issue
Block a user