Feedback Do anamerge first: it's recursion is right-associative 

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)
Re: Sad Problems still (Mamun Tanveer)
Date: 2001, Nov 28
From: Mike O'Donnell <odonnell@cs.uchicago.edu>

concatenating words with the same canonical form
Be real careful with technical terms. If you concatenate the words "tar" and "rat", you get the word "tarrat". Surely you mean that you combine these words into lists, not that you concatenate them. You have a similar type error in your use of "append" toward the end.

Don't try to figure out mergehead until you have a good idea for the final line (between in and end) of the definition of anamerge. These sorts of programs are always constructed backwards. In trying to define anamerge, you see the need for mergehead, and you see what it has to accomplish.

The most natural form of recursion over a list is right-associative, as we saw in the reduce function from LISP and some of its variations. If you define anamerge in a right associative fashion, then mergehead's job will be to merge a single pair into the head of a list that's already been merged.




Mike O'D.


Messages

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: "Do anamerge first: it's recursion is right-associative"