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 [2007/12/28 12:29] – fixed tvcutsem | at:tutorial:basic [2008/03/12 17:17] – * tvcutsem | ||
---|---|---|---|
Line 417: | Line 417: | ||
if: booleanCondition then: consequent | if: booleanCondition then: consequent | ||
if: booleanCondition then: consequent else: alternative | if: booleanCondition then: consequent else: alternative | ||
- | while: | + | while: |
- | foreach: | + | foreach: |
- | do: body if: condition | + | do: bodyClosure |
- | do: body unless: condition | + | do: bodyClosure |
</ | </ | ||
- | Note that '' | + | <note warn> |
+ | Note that '' | ||
+ | </ | ||
- | An example of usage for some of these structures is shown below in the definition of the sort function. | + | The above definitions in the lexical root of AmbientTalk are simply convenience functions for the methods defined on booleans and closures. For example, an if-statement can also be encoded as a message send, as in Smalltalk: '' |
+ | |||
+ | An example of usage for some of the above structures is shown below in the definition of the sort function. | ||
< | < | ||
>def sort(table, cmp := { |e1,e2| e1 < e2 }) { | >def sort(table, cmp := { |e1,e2| e1 < e2 }) { |
at/tutorial/basic.txt · Last modified: 2020/02/09 22:05 by elisag