This commit is contained in:
Zahary Karadjov 2017-10-07 21:49:11 +03:00 • committed by Araq
commit 70380882c5
2 changed files with 21 additions and 5 deletions

View file

@ -0,0 +1,13 @@
type
Comparable = concept a
(a < a) is bool
proc myMax(a, b: Comparable): Comparable =
if a < b:
return b
else:
return a
doAssert myMax(5, 10) == 10
doAssert myMax(31.3, 1.23124) == 31.3