
8 Dec
2011
8 Dec
'11
5:30 a.m.
Alexej> The interesting thing is, that if I change the "case ... of" Alexej> statement to an "if ... then ... else" statement, this magically Alexej> starts to work. Since I no longer am enrolled (I have to take Alexej> the course next year), I can't ask a teacher, but my curiosity Alexej> still bugs me. Why doesn't this work? And why does it work with Alexej> a "if ... then ...else" statement? maybe you mixed up 'if' and 'case' usages. In fact, 'if' can alway be translated to 'case' by matching on the boolean condition, like below : case (s == reverse s) of True -> "s is a palindrome" False -> "s is not a palindrome -- Paul