default.txt 637 B

1234567891011121314151617181920212223
  1. (* This is a
  2. multiline, (* nested *) comment *)
  3. type point = { x: float; y: float };;
  4. let some_string = "this is a string";;
  5. let rec length lst =
  6. match lst with
  7. [] -> 0
  8. | head :: tail -> 1 + length tail
  9. ;;
  10. exception Test;;
  11. type expression =
  12. Const of float
  13. | Var of string
  14. | Sum of expression * expression (* e1 + e2 *)
  15. | Diff of expression * expression (* e1 - e2 *)
  16. | Prod of expression * expression (* e1 * e2 *)
  17. | Quot of expression * expression (* e1 / e2 *)
  18. class point =
  19. object
  20. val mutable x = 0
  21. method get_x = x
  22. method private move d = x <- x + d
  23. end;;