Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | Both sides next revision | ||
| alvis:exec [2017/01/11 22:40] marcin removed | — (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Exec statement ====== | ||
| - | The **exec** statement is used to assign a value of an expression to a parameter. The statement is the default one, thus the **exec** keyword can be omitted. The expression can take a form of: | ||
| - | * literal value, | ||
| - | * parameter, | ||
| - | * Haskell expression (probably with some Haskell functions). | ||
| - | |||
| - | The **exec** statement is a single-step statement. | ||
| - | |||
| - | < | ||
| - | exec parameter = expression; | ||
| - | parameter = expression; | ||
| - | </ | ||
| - | |||
| - | **Listing 1. ** Exec statement syntax | ||
| - | |||
| - | |||
| - | < | ||
| - | x = 7; | ||
| - | exec x = 7; | ||
| - | x = x + 1; | ||
| - | x = sqrt x + 2; | ||
| - | </ | ||
| - | |||
| - | **Listing 2. ** Exec statement examples | ||
| - | |||
| - | |||
| - | |||
| - | **[[: | ||