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/04/06 08:27] – * elisag | at:tutorial:basic [2007/04/06 08:30] – * elisag | ||
---|---|---|---|
Line 253: | Line 253: | ||
>" | >" | ||
>> | >> | ||
- | >" | + | >" |
>> | >> | ||
- | >" | + | >" |
+ | |vowel| vowel.toUpperCase() | ||
+ | } | ||
>>" | >>" | ||
>" | >" | ||
Line 301: | Line 303: | ||
Boolean infix operators such as & and | are not shortcut. Thus, both arguments will be evaluated. For lazy evaluation, you should use the natives methods. For example, false.and: { 1/0 } will return false without executing the second argument. | Boolean infix operators such as & and | are not shortcut. Thus, both arguments will be evaluated. For lazy evaluation, you should use the natives methods. For example, false.and: { 1/0 } will return false without executing the second argument. | ||
- | |||
===== Control Flow Structures ===== | ===== Control Flow Structures ===== | ||
Line 322: | Line 323: | ||
def pivot := table[(left+right) /- 2]; | def pivot := table[(left+right) /- 2]; | ||
def save := nil; | def save := nil; | ||
- | | + | |
while: { cmp(table[left], | while: { cmp(table[left], | ||
- | left := left + 1 | + | left := left + 1 }; |
- | | + | |
while: { cmp(pivot, table[right]) } do: { | while: { cmp(pivot, table[right]) } do: { | ||
- | right := right - 1 | + | right := right - 1 }; |
- | | + | |
if: (left <= right) then: { | if: (left <= right) then: { | ||
// swap elements | // swap elements |
at/tutorial/basic.txt · Last modified: 2020/02/09 22:05 by elisag