Updated Programming language specification (Gemstone) (markdown)
parent
934571bb7b
commit
6a3e4c9e46
|
@ -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.
|
||||
|
||||
## 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 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.
|
||||
|
|
Loading…
Reference in New Issue