Fix a bug in translating (n+k) patterns to code.

14 Sep
2001
14 Sep
'01
12:12 p.m.
malcolm: Fri Sep 14 18:12:57 CEST 2001 Update of /usr/src/master/nhc/src/compiler98 In directory hinken:/tmp/cvs-serv722 Modified Files: Case.hs Log Message: Fix a bug in translating (n+k) patterns to code. The symptom was that foo (n+1) Foo = 1 foo (n+1) Bar = 2 foo _ _ = 3 main = print (foo 1 Bar) was offering 3 as result, not 2 as expected. The cause was that the two equations were being matched in an nested if..then..else sequence, with (n>=1) as the condition. The correct way is to sequence the matches with FATBAR, so the second match is actually attempted.
8652
Age (days ago)
8652
Last active (days ago)
0 comments
1 participants
participants (1)
-
malcolmīŧ sparud.net