Sad Problems still 

Forum: Com Sci 221, U Chicago, Autumn 2001, Discuss Classwork
Re: News Assignment #8 due Monday, 26 November (Mike O'Donnell)
Re: Sad Anamerge Confusion (Mamun Tanveer)
Date: 2001, Nov 28
From: Mamun Tanveer <mamunt@uchicago.edu>

I'm still having several problems with anamerge and mergehead. The only way I can make mergehead do anything even close to what its supposed to is by concatenating words with the same canonical form, and that includes changing the types from what was given, i.e.

mergehead (c1, w1) ((c2, l2)::rr) = mergehead (c1, (w1^l2)) rr

If I leave the c2::l2 the way it is, then concatenation fails since l2 is the list word::nil instead of just a word.

Anything other than concatenation or appending has left me with errors since mergehead only takes arguments (c1, w1) and w1 is not apparently allowed to be a list that you can keep adding to (for whatever reason unknown to me).

My idea for mergehead was simply to take a list of pairs with the same c1, c2, etc (canonical forms) and append a list of words (w1, l2, etc.) to the canonical form. Then anamerge simply consists of applying this to the first pair p1 and using the rest of the pair list r as the (c2::l2)::rr in the mergehead. I've tried just about every variation in syntax, so I'm thinking I've made a more fundamental error, that I just don't see. Anyone see anything I've missed? Thanks.

Mamun


Messages

1. Feedback wrong order by Jesse Dailey, 2001, Nov 28
1. Agree Yes: list recursion is usually right-associative by Mike O'Donnell, 2001, Nov 28
2. Question the other place? by Mamun Tanveer, 2001, Nov 28
1. Feedback [] is the place in the base case by Mike O'Donnell, 2001, Nov 28
2. Feedback Do anamerge first: it's recursion is right-associative by Mike O'Donnell, 2001, Nov 28
1. Question How to get to the end of the list by Mamun Tanveer, 2001, Nov 28
(_ Feedback Write the last line of the anamerge definition first by Mike O'Donnell, 2001, Nov 29

to: "Problems still"