at:tutorial:basic
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
at:tutorial:basic [2008/03/12 17:16] – tvcutsem | at:tutorial:basic [2008/07/03 16:20] – * tvcutsem | ||
---|---|---|---|
Line 245: | Line 245: | ||
def i := 0; | def i := 0; | ||
def mapped[tbl.length] { | def mapped[tbl.length] { | ||
- | | + | i := i+1; |
+ | clo( tbl[ i ] ) | ||
}; | }; | ||
} | } | ||
Line 415: | Line 416: | ||
Control flow constructs are defined in the lexical root of AmbientTalk. The lexical root is an object containing globally visible native methods (i.e. it is the top-level environment). We have already seen in the previous sections examples of use of the foreach and if/then structures. A list of traditional control flow structures defined in AmbientTalk is shown below: | Control flow constructs are defined in the lexical root of AmbientTalk. The lexical root is an object containing globally visible native methods (i.e. it is the top-level environment). We have already seen in the previous sections examples of use of the foreach and if/then structures. A list of traditional control flow structures defined in AmbientTalk is shown below: | ||
< | < | ||
- | if: booleanCondition then: consequent | + | if: booleanCondition then: consequentClosure |
- | if: booleanCondition then: consequent | + | if: booleanCondition then: consequentClosure |
while: conditionClosure do: body | while: conditionClosure do: body | ||
foreach: iteratorClosure in: table | foreach: iteratorClosure in: table | ||
Line 424: | Line 425: | ||
<note warn> | <note warn> | ||
- | Note that '' | + | Note that '' |
</ | </ | ||
at/tutorial/basic.txt · Last modified: 2020/02/09 22:05 by elisag