Here we show an example of a module describing a simple bank.

The example shows the declaration of a module object, Bank -- a module is a singular object. The '=' sign declares Bank to be a constant  reference. The rest of the example describes the Bank object:

Bank: =
   %include String   
   Account(id: ?String):
      balance: ?integer
      deposit(amount: ?integer):
         balance := balance + amount
      withdraw(amount: ?integer):
         balance:= balance - amount
      display:
         id.print
         put(':')
         putint(balance)
         put(10)
   Joe: =Account("Joe")
   Mary: ?Account
   Mary := Account("Mary")
   Joe.deposit(500)
   Mary.deposit(300)
   Joe.withdraw(150)
   Joe.display
   Mary.display
   Mary := Joe
   Mary.display

The %include String directive imports/includes the String module - which has a pattern String (in subsequent versions, include of standard patterns like String will not be needed).

The Bank object has a pattern Account. Account has an argument id - the '?' declares is to be a variable that may refer arbitrary objects - in this case instances of String.

Account has a data-item balance of type integer, and three local patterns: deposit, withdraw and display. Deposit and withdraw both have a parameter, (amount) and they update balance

Account also has two data-items: Joe, which is a constant reference to an Account object, and Mary, which is a variable reference to arbitrary Account objects.

Joe is by declaration assigned an instance of Account("Joe") - an actual parameter must be supplied when creating an instance of Account.

Mary is assigned a instances of Account("Mary").

The remaining statements invokes patterns attributes of Joe and Mary.

The block-structure, nesting of objects and patterns, is described by the indentation level. All declarations and statements of an object must be indented to the same level.

Note! In the current version, it is easy to confuse constant references with assignment. For a constant references there must be at least one space between ':' and '=' in order to distinguish it from assignment (':='). We may change assignment to '<-'.