On 10 November 2013 19:55, Tarek Ziadé email@example.com wrote:
From the documentation example:
fun sum(l): cases(List) l: | empty => 0 | link(first, rest) => first + sum(rest) end where: sum() is 0 sum([1, 2, 3]) is 6 end
It would make more sense to just bake py.test style rich assertions into the language in some way and let people write:
def sum(iterable): # implementation of sum assert sum() == 0 assert sum([1, 2, 3]) == 6
A mechanism to say "always execute assert statements in this module regardless of optimisation level" could also be useful.
-- Nick Coghlan | firstname.lastname@example.org | Brisbane, Australia