Updated Programming language specification (Gemstone) (markdown)

Filleo 2024-04-10 13:41:52 +02:00
parent 934571bb7b
commit 6a3e4c9e46
1 changed files with 53 additions and 0 deletions

@ -234,6 +234,59 @@ local float a = 7.0
In this example the reference b still yields the value 5 stored in the original memory of variable a as is was defined in the first line. After the shadowing of variable a the new value of a occupies indipendant memory and has no influence of reference b. In this example the reference b still yields the value 5 stored in the original memory of variable a as is was defined in the first line. After the shadowing of variable a the new value of a occupies indipendant memory and has no influence of reference b.
## flow control
### if
```scala
if (bedingung)
{
}
if bedingung {funktion}
if x == 5 {blahaj()}
bedingung MUSS ein primitive oder composite sein mit 0 == false und !0 == true
bedingung kann keine Funktion sein. funktionen müssen zuerst aufgelößt werden mit einer variable.
optional else:
if bedingung {funktion} else {funktion}
optional else if:
if bedingung {funktion} else if bedingung {funktion}
```
### while
```scala
while bedingung {fuktion}
bedingung MUSS ein primitive oder composite sein mit 0 == false und !0 == true
bedingung kann keine Funktion sein. funktionen müssen zuerst aufgelößt werden mit einer variable.
x == 0
while x < 5
{
. . .
x + 1
}
```
## Functions ## Functions
Functions group together expressions. A function is uniquely identified by an identifier. They declare at least one list of parameters. Parameter lists declare the order an type of variables which are passed to the function when calling and are available during its execution. Parameter declarations can be extended with IO-qualifier. Functions group together expressions. A function is uniquely identified by an identifier. They declare at least one list of parameters. Parameter lists declare the order an type of variables which are passed to the function when calling and are available during its execution. Parameter declarations can be extended with IO-qualifier.