fork(1) download
  1. type BankAccount(initialSold : float, Owner : string) =
  2. let TransactHistory : string [] = null
  3. member val Sold = initialSold with get, set
  4. member this.Owner = Owner
  5. member this.DoTransaction(t : TransactionType) =
  6. let transaction = Transaction(this, t)
  7.  
  8. override this.ToString() =
  9. this.Owner + " has " + this.Sold.ToString() + " $."
  10.  
  11. type TransactionType =
  12. | Deposit of float
  13. | Withdraw of float
  14. | Transfer of BankAccount * float
  15.  
  16. type Transaction(hostAccount : BankAccount, transactionType) =
  17. do match transactionType with
  18. | Deposit amount -> hostAccount.Sold <- hostAccount.Sold + amount
  19. | Withdraw amount -> hostAccount.Sold <- hostAccount.Sold - amount
  20. | Transfer (target, amount) -> hostAccount.Sold <- hostAccount.Sold - amount; target.Sold <- target.Sold + amount
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/home/N93hPc/prog.fs(6,10): error FS0588: Block following this 'let' is unfinished. Expect an expression.
stdout
Standard output is empty