at:tutorial:modular
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
at:tutorial:modular [2010/06/15 17:01] – * tvcutsem | at:tutorial:modular [2013/05/17 20:24] (current) – adjusted tvcutsem | ||
---|---|---|---|
Line 119: | Line 119: | ||
In this section, we describe how the '' | In this section, we describe how the '' | ||
+ | |||
==== import as trait composition ==== | ==== import as trait composition ==== | ||
Line 162: | Line 163: | ||
}; | }; | ||
def each: clo { | def each: clo { | ||
- | start.to: end do: clo | + | start.to: end-1 do: clo |
}; | }; | ||
}; | }; | ||
Line 183: | Line 184: | ||
So, '' | So, '' | ||
- | Note that in AmbientTalk, | + | Note that in AmbientTalk, |
< | < | ||
Line 266: | Line 267: | ||
Type tags can best be compared to empty Java interface types. Such empty interfaces are sometimes used in Java purely for the purposes of marking an object. Examples are '' | Type tags can best be compared to empty Java interface types. Such empty interfaces are sometimes used in Java purely for the purposes of marking an object. Examples are '' | ||
</ | </ | ||
+ | |||
==== Native Type Tags ==== | ==== Native Type Tags ==== | ||
- | The module ''/ | + | The module ''/ |
< | < | ||
- | is: 1 taggedAs: / | + | is: 1 taggedAs: /.at.lang.types.Number |
>> true | >> true | ||
- | is: " | + | is: " |
>> true | >> true | ||
</ | </ | ||
- | The type ''/ | + | The type ''/ |
==== Type tags as annotated message sends ==== | ==== Type tags as annotated message sends ==== | ||
Line 290: | Line 292: | ||
In the [[at: | In the [[at: | ||
+ | |||
===== Exception Handling ===== | ===== Exception Handling ===== | ||
Line 313: | Line 316: | ||
</ | </ | ||
- | Note that a new instance of an object named '' | + | Note that a new instance of an object named '' |
< | < | ||
- | deftype DivisionByZero <: lobby.at.types.Exception; | + | deftype DivisionByZero <: lobby.at.lang.types.Exception; |
- | def XDivisionByZero := lobby.at.exceptions.createException(DivisionByZero); | + | def XDivisionByZero := lobby.at.lang.exceptions.createException(DivisionByZero); |
</ | </ | ||
Line 343: | Line 346: | ||
system.println(exc.message); | system.println(exc.message); | ||
}; | }; | ||
- | }) | + | } taggedAs: [/ |
</ | </ | ||
Line 373: | Line 376: | ||
def contains(tbl, | def contains(tbl, | ||
{ |return| | { |return| | ||
- | 1.to: tbl.length | + | 1.to: tbl.length do: { |i| |
if: (tbl[i] == elt) then: { | if: (tbl[i] == elt) then: { | ||
return(true) | return(true) |
at/tutorial/modular.1276614093.txt.gz · Last modified: 2010/07/26 15:20 (external edit)