-
Notifications
You must be signed in to change notification settings - Fork 12
Exploring the Language 1
netrium edited this page Mar 24, 2012
·
10 revisions
The following sample contract extends the top contract by adding a payment (give) of one EUR to the existing receipt of one GBP at the time of acquisition.
contract = one (Financial gbp cash Nothing) `and` give (one (Financial eur cash Nothing))The Syntax Tree is now:
The Decision Tree now shows this as follows:
contract = scale 1000 (one (Financial gbp cash Nothing))The scale keyword acts as a multiplier. It is used to multiply the child contract by a factor. In the above example, the contract acquirer now receives 1,000 GBP at the moment of contract acquisition.
The Syntax Tree for this contract:
The Decision Tree now shows:
scale can be added to a contract many times. There are times that this can be useful, especially when working with multiple independent external observables.
contract = scale 2000 (scale 1000 (one (Financial gbp cash Nothing)))This now shows as:
The Decision Tree now shows:
A suite of samples is available here.