tcomparable.nim 208 B

1234567891011121314
  1. type
  2. Comparable = concept a
  3. (a < a) is bool
  4. proc myMax(a, b: Comparable): Comparable =
  5. if a < b:
  6. return b
  7. else:
  8. return a
  9. doAssert myMax(5, 10) == 10
  10. doAssert myMax(31.3, 1.23124) == 31.3