The following code shows the Ximp language output for some specific input, showing some of the benefits from using such a nice language.
an Account
is positive? { @amount >= 0 }
withdraw { (amount is (@amount - value)) }
my_account is Account (amount is 1000)
my_account is positive?
new_account is (withdraw from my_account (value is 300))
new_account is my_account after withdraw (value is 300)
Another type:
a Manager
ximp my Account
with a Manager
my_account is Account(owner is "guilherme", amount is 50)
paulo is Manager(name is "Paulo Silveira")
my_account's manager is paulo
print my_account's manager's name
Paulo Silveira
The following examples show how it is easy to define new macros.
yo, tell me my_account's manager's name
Carlos
my_account, sup dawg?
my owner is guilherme, amount is 50, manager's name is Carlos
Hmmm "if you want to contribute, just fork me!"
whatever