Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Both sides next revision | ||
alvis:exec [2013/12/14 23:42] marcin | — (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 | ||
- | |||
- | |||
- | |||
- | **[[: |