at:tutorial:appendix
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:appendix [2009/01/29 21:56] – * elisag | at:tutorial:appendix [2020/02/05 20:57] – adding elisag | ||
---|---|---|---|
Line 27: | Line 27: | ||
This will execute all '' | This will execute all '' | ||
- | Like in JUnit and SUnit, it is possible to define two methods named '' | + | Like in JUnit and SUnit, it is possible to define two methods named '' |
==== Assertions ==== | ==== Assertions ==== | ||
Line 392: | Line 392: | ||
The files in the '' | The files in the '' | ||
- | ==== Futures and Multifutures ==== | ||
- | === Futures === | + | ==== Futures |
The module ''/ | The module ''/ | ||
Line 417: | Line 416: | ||
</ | </ | ||
- | Finally, | + | === Auxilary functions in the futures module ==== |
+ | |||
+ | The futures module also provides some auxiliary functions, of which '' | ||
< | < | ||
- | when: (group: [ a<-m(), b<-n() ]) becomes: { |values| | + | when: (group: [ a<-m()@FutureMessage, b<-n()@FutureMessage |
def [aResult, bResult] := values; | def [aResult, bResult] := values; | ||
... | ... | ||
Line 426: | Line 427: | ||
</ | </ | ||
- | === Multifutures === | + | Another useful auxilary function is '' |
+ | |||
+ | < | ||
+ | future: { |return| | ||
+ | // some computation | ||
+ | return(val) | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | This is actually equivalent to the slightly more verbose code: | ||
+ | |||
+ | < | ||
+ | def [fut,res] := makeFuture(); | ||
+ | try: { // some computation | ||
+ | res.resolve(val); | ||
+ | } catch: Exception using: { |e| res.ruin(e) } | ||
+ | fut; | ||
+ | </ | ||
+ | |||
+ | ==== Multifutures | ||
The module ''/ | The module ''/ | ||
Line 472: | Line 492: | ||
< | < | ||
- | The implementation of leased object references actually consists of two files: ''/ | + | The implementation of leased object references actually consists of two files: ''/ |
</ | </ | ||
The '' | The '' | ||
* '' | * '' | ||
- | * '' | + | * '' |
* '' | * '' | ||
- | Variations of these constructs are also provided to allow developers to specify the renewal time interval in renew-on-call leased references and the name(s) of the method(s) which expires | + | Variations of these constructs are also provided to allow developers to specify the renewal time interval in renew-on-call leased references and the name(s) of the method(s) which trigger expiration of a single-call leased reference. |
- | The '' | + | The '' |
< | < | ||
- | renew: leasedRef for: interval; | + | renew: leasedRef for: interval; |
- | revoke: leasedRef; | + | revoke: leasedRef; |
- | leaseTimeLeft: | + | leaseTimeLeft: |
+ | when: lease expired: {...}; // trigger a closure when the lease expires | ||
</ | </ | ||
- | '' | + | The '' |
Finally, the '' | Finally, the '' | ||
Line 652: | Line 673: | ||
==== Object Inspector ==== | ==== Object Inspector ==== | ||
- | The module ''/ | + | The module ''/ |
< | < | ||
- | import /.at.support.inspector; | + | import /.demo.inspector; |
inspect(o); | inspect(o); | ||
</ | </ |
at/tutorial/appendix.txt · Last modified: 2021/09/24 10:28 by elisag