Update page 'Aer v1.0 Specification'

2018-08-12 13:08:36 +02:00
parent 4b8bad2b51
commit b79bde975d

@@ -73,10 +73,11 @@ A constant is an identifier for a value which cannot change during the execution
## 4. Basic concept
### 4.1. Script startup
Aer is an interpreted language, thus a program or script does not have to be compiled as an application that may be started. An interpreted program shall contain exactly one method qualifying as an entry point by satisfying the following requirements:
* It has to be a constructor of class named *Main*,
* It has to be a method called *main()* of class named *Program*,
* The return type shall be void or int,
* It shall not be a partial method without an implementation,
* The formal parameter list shall either be empty, or have a single value parameter of type string[],
Additionally, if *Program* class implements a constructor, it will be optionally called before *main()* method.
### 4.2. Script termination
If the return type of the script's entry point method is int, the value returned serves as the scripts's termination status code. The purpose of this code is to allow communication of success or failure to the execution environment. If the return type of the entry point method is void, reaching the right brace (}) that terminates that method, or executing a return statement that has no expression, results in a termination status code of 0.
@@ -558,8 +559,8 @@ Object attributes are the data bundled in an instance of a class. The object att
public string $name = '';
}
class Main {
public void __construct() {
class Program {
public void main() {
object $person1, $person2;
$person1 = new Person();
@@ -588,8 +589,8 @@ Methods are functions defined inside the body of a class. They are used to perfo
}
}
class Main {
public void __construct() {
class Program {
public void main() {
object $c = new Circle();
$c->setRadius(5);
print('Area is: ' . $c->area());
@@ -728,8 +729,8 @@ In above situation, class Derived inherits method funcA() from Base1 class, and
class Derived2 extends Base2, Base1 {
}
class Main {
public void __construct() {
class Program {
public void main() {
object $a = new Derived1();
object $b = new Derived2();
$a->funcA();