<div>Dear Dr. Felleisen, </div>  <div>thanks so much for responding!&nbsp; Your suggestions really helped me to think about the problem.</div>  <div>&nbsp;</div>  <div>Here's a table of examples, as you suggested:</div>  <div>&nbsp;</div>  <div>;;Examples <BR>; s | low&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |(first..)|(rest..)&nbsp;&nbsp;&nbsp; | result<BR>;--------------------------------------------------------------------------------------------------------<BR>; X | '(AT)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |'(AT)&nbsp;&nbsp;&nbsp; |empty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | '((XAT) (AXT) (ATX))<BR>; X | '((AB) (CD) (EF))|'(AB)&nbsp;&nbsp;&nbsp; |'((CD) (EF))| '((XAB) (AXB) (ABX) (XCD) (CXD) (CDX) (XEF) (EXF) (EFX))<BR></div>  <div>Here's an attempt to "go from the first columns to the last":&nbsp; </div>  <div><BR>; Definitions:<BR>(define (insert-everywhere/in-all-words s low)<BR>&nbsp;
 (cond<BR>&nbsp;&nbsp;&nbsp; [(empty? (rest low)) empty]<BR>&nbsp;&nbsp;&nbsp; [else (append (insert-in-single-word s (first low)) (insert-everywhere/in-all-words s (rest low)))]))</div>  <div>&nbsp;</div>  <div>(define (insert-in-single-word s word)<BR>&nbsp; (cond<BR>&nbsp;&nbsp;&nbsp; [(empty? (rest word)) empty]<BR>&nbsp;&nbsp;&nbsp; [else (append (list (first word) s (rest word)) (insert-in-single-word s (rest word)))]))<BR></div>  <div>Unfortunately, the list of words gets shorter and shorter (sATX, sTX, sX).&nbsp; I tried to think of a way to add a recursive "prefix" that gets longer, but each time the function cycles the first letters seem to disappear into the void...</div>  <div><BR><B><I>Matthias Felleisen &lt;matthias@ccs.neu.edu&gt;</I></B> wrote:</div>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>  <DIV>On Mar 25, 2008, at 1:48 PM, Cooke Kelsey wrote:  <BLOCKQUOTE type="cite">  <DIV><SPAN
 class=Apple-style-span style="-webkit-text-stroke-width: -1">I am trying to learn HtDP by myself, and like Dave Yrueta I am stumped by 12.4.2.&nbsp;</SPAN></DIV></BLOCKQUOTE>  <DIV><BR></DIV>[Oops I forgot to reply to his last message.]<BR><BR><BR>  <BLOCKQUOTE type="cite">  <DIV><SPAN class=Apple-style-span style="-webkit-text-stroke-width: -1">; Purpose: to insert a symbol between every letter of every word, e.g. X, AT--&gt;XAT, AXT, ATX.</SPAN></DIV></BLOCKQUOTE>  <DIV><BR></DIV>  <DIV>Please reformulate the example in terms of symbols and lists.&nbsp;</DIV>  <DIV><BR></DIV><BR>  <BLOCKQUOTE type="cite">  <DIV>&nbsp;<SPAN class=Apple-style-span style="-webkit-text-stroke-width: -1">;Function Template:&nbsp;</SPAN></DIV>  <DIV>(define (insert-everywhere/in-all-words s low)<BR>&nbsp; (cond<BR>&nbsp;&nbsp;&nbsp; [(empty? (rest low))...]<BR>&nbsp;&nbsp;&nbsp; [else ...(first low)...insert-everywhere/in-all-words s (rest low)]))<BR></DIV>  <DIV>Note: </DIV>  <DIV>It is
 suggested to use "append", which is easy one or two times---(append x&nbsp;word) or&nbsp;(append&nbsp;(append&nbsp;(first word) x) (rest word))----but I can't see how to use this recursively for an arbitrary number of letters and words.&nbsp;</DIV></BLOCKQUOTE>  <DIV><BR></DIV>  <DIV>So far so good. Let's try what HtDP/2e will introduce:&nbsp;</DIV>  <DIV><BR></DIV>  <DIV>Please make a table of the following shape:&nbsp;</DIV>  <DIV><BR></DIV>  <DIV>&nbsp;s &nbsp; | &nbsp; low &nbsp;| &nbsp; (first low) &nbsp;| &nbsp;(insert-everywhere/in-all-words s (rest low) | expected result for (insert-... s low)</DIV>  <DIV>--------------------------------------------------------------------------------------------------------</DIV>  <DIV>&nbsp;X &nbsp; | &nbsp; AT &nbsp; | &nbsp; &nbsp; ? &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp;use the purpose statement to determine this | &nbsp; (list `XAT' `AXT' `ATX')</DIV>  <DIV><BR></DIV>  <DIV><BR></DIV>  <DIV>As I said, you need to
 reformulate this in terms of symbols and lists. If it doesn't jump out at you how to go from the four columns to the last one, then make a couple of more examples. I am pretty sure it will. Here is the rule of thumb:&nbsp;</DIV>  <DIV><BR></DIV>  <DIV>&nbsp;--&gt; you know of a built-in function/primitive that does the work&nbsp;</DIV>  <DIV>&nbsp;--&gt; you don't. in this case, you make a wish: a purpose statement and a contract for a helper function that does it for you.&nbsp;</DIV>  <DIV><BR></DIV>  <DIV>You may also have to combine a primitives with functions.&nbsp;</DIV>  <DIV><BR></DIV>  <DIV>Please report back -- Matthias</DIV>  <DIV><BR></DIV>  <DIV><BR></DIV>  <DIV><BR></DIV>  <DIV><BR></DIV>  <DIV><BR></DIV>  <DIV><BR></DIV><BR>  <BLOCKQUOTE type="cite">  <DIV></DIV>  <DIV>&nbsp;</DIV>  <DIV>The fact that the "hint" refers to the keyword list, which the book hasn't covered yet,&nbsp;makes me wonder if it's even possible to answer this problem, given what we know
 so far...</DIV>  <DIV>&nbsp;</DIV>  <DIV>Thanks very much, </DIV>  <DIV>&nbsp;</DIV>  <DIV>Cooke</DIV>  <DIV><BR class=khtml-block-placeholder></DIV>  <HR SIZE=1>  Looking for last minute shopping deals? <A href="http://us.rd.yahoo.com/evt=51734/*http://tools.search.yahoo.com/newsearch/category.php?category=shopping">Find them fast with Yahoo! Search.</A>  <DIV style="MARGIN: 0px">_________________________________________________</DIV>  <DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>&nbsp; </SPAN>For list-related administrative tasks:</DIV>  <DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>&nbsp; </SPAN><A href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</A></DIV></BLOCKQUOTE></DIV><BR></BLOCKQUOTE><BR><p>&#32;
      <hr size=1>Looking for last minute shopping deals? <a href="http://us.rd.yahoo.com/evt=51734/*http://tools.search.yahoo.com/newsearch/category.php?category=shopping"> 
Find them fast with Yahoo! Search.</a>