From 28ce9a4a1509d36df1700f44c26b0cd52e22f715 Mon Sep 17 00:00:00 2001 From: Rafal Kupiec Date: Sat, 27 Oct 2018 22:25:26 +0200 Subject: [PATCH] Update page 'Aer v1.0 Specification' --- Aer-v1.0-Specification.md | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/Aer-v1.0-Specification.md b/Aer-v1.0-Specification.md index 36bd927..fe0f881 100644 --- a/Aer-v1.0-Specification.md +++ b/Aer-v1.0-Specification.md @@ -252,17 +252,9 @@ An example: int $integer = 7 + (int) $str; // contains value: 52 ### 5.14. References -References in Aer are a means to access the same variable content by different names. They are not like C pointers; for instance, they does not allow to perform pointer arithmetic using them, they are not actual memory addresses, and so on. Instead, they are symbol table aliases. There are three basic operations performed using references: assigning by reference, passing by reference, and returning by reference. +References in Aer are a means to access the same variable content by different names. They are not like C pointers; for instance, they does not allow to perform pointer arithmetic using them, they are not actual memory addresses, and so on. Instead, they are symbol table aliases. There are two basic operations performed using references: passing by reference and returning by reference. -#### 5.14.1. Assign By Reference -In the first of these, Aer references allow to make two variables refer to the same content. - - int &$a, $b; - $a = $b; - -It means that $a and $b point to the same content. - -#### 5.14.2. Return Reference +#### 5.14.1. Return Reference When a function returns a reference, it returns an implicit pointer to its return value. This way, a function can be used on the left side of an assignment statement. int[] $table = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}; @@ -271,7 +263,7 @@ When a function returns a reference, it returns an implicit pointer to its retur return $table[$i]; // returns a reference to the ith element } -#### 5.14.3. Pass By Reference +#### 5.14.2. Pass By Reference This is done by making a local variable in a function and a variable in the calling scope referencing the same content. int func(int &$val) {