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/17 17:25] – tvcutsem | at:tutorial:basic [2007/04/17 17:30] – tvcutsem | ||
---|---|---|---|
Line 293: | Line 293: | ||
Beware of the precedence rules for function application versus method invocation, which may lead to unexpected results, e.g.: | Beware of the precedence rules for function application versus method invocation, which may lead to unexpected results, e.g.: | ||
- | </code> | + | < |
> | > | ||
>>-1 | >>-1 | ||
- | < | + | </code> |
This code is interpreted as '' | This code is interpreted as '' | ||
Line 384: | Line 384: | ||
==== Booleans ==== | ==== Booleans ==== | ||
- | + | As any native type, booleans are objects so, they respond to keyword messages such as: | |
- | AmbientTalk supports infix operators for booleans as &, | and !. As any native type, booleans are objects so, they respond to keyword messages such as: | + | |
< | < | ||
< | < | ||
Line 393: | Line 392: | ||
</ | </ | ||
- | **=** and **!=** are the infix operators for equality and inequality. | + | '' |
< | < | ||
>(0 < 1).ifTrue: { 0 } | >(0 < 1).ifTrue: { 0 } | ||
Line 407: | Line 406: | ||
</ | </ | ||
- | 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. | + | Compound boolean expressions can be created by means of a boolean' |
===== Control Flow Structures ===== | ===== Control Flow Structures ===== |
at/tutorial/basic.txt · Last modified: 2020/02/09 22:05 by elisag