Re: [racket] [htdp] Help with Exercise 12.4.2

2010-07-08 Thread Matthias Felleisen
On Jul 7, 2010, at 10:31 PM, Sam Griff wrote: >> You're not consistent with the formatting of your documentation. > Yeah... Sorry about that... I was mostly documenting the functions in > a way that would most help me understand what was going on. I agree > with you consistent documentation is im

Re: [racket] [htdp] Help with Exercise 12.4.2

2010-07-07 Thread Sam Griff
> You're not consistent with the formatting of your documentation. Yeah... Sorry about that... I was mostly documenting the functions in a way that would most help me understand what was going on. I agree with you consistent documentation is important. > So, is that table really useful? I think so

Re: [racket] [htdp] Help with Exercise 12.4.2

2010-07-07 Thread Marco Morazan
So, is that table really useful? I am not trying to be funny here. I've chimed in the past on this problem to the point that some website (according to my students) has earmarked me the expert on this problem--some honor! In any case, it seems to me that you can get to the solution by being discipl

Re: [racket] [htdp] Help with Exercise 12.4.2

2010-07-07 Thread Horace Dynamite
Well done Sam! Some small suggestions though. You're not consistent with the formatting of your documentation. Chose either the verbose documentation format, i.e., ;; Contract ;; Purpose ;; Template ;; Definition ;; Examples/Tests Or the concise format (more common)

Re: [racket] [htdp] Help with Exercise 12.4.2

2010-07-07 Thread Sam Griff
I think I got it! It produces the correct results, but I'm not sure if it follows the design pattern properly: ;; A word is either ;; 1. empty, or ;; 2. (cons s w) ;;where s is a symbol and w is a word ;; Examples: ;; (cons 'a empty) ;; (cons 'h (cons 'i empty)) ;; (cons 'c (cons 'a (cons 't

Re: [racket] [htdp] Help with Exercise 12.4.2

2010-07-07 Thread Sam Griff
> Isn't that too much help? I don't think so because I know there is a problem with the second clause and thinking recursively. I made a few charts like you suggested: s | w| (first w) | (insert-everywhere/in-single-word s (rest w)) | expect

Re: [racket] [htdp] Help with Exercise 12.4.2

2010-07-07 Thread Jos Koot
Dear Sam I may have given less than a clue, but now you alre4ady have got too much of it. My idea was to make you thinking: A word is a list of letters. Then: what is a list of words? How do I add a letter to a word? How do I add a word to a list of words? And finally: how do I add a letter to

Re: [racket] [htdp] Help with Exercise 12.4.2

2010-07-07 Thread Matthias Felleisen
Isn't that too much help? On Jul 6, 2010, at 6:46 PM, David Yrueta wrote: > my base case the function should return a > list of words but before returned a single word. > > Very good decision. Now take a close look at how you phrased the second > condition. According to the design recipe,

Re: [racket] [htdp] Help with Exercise 12.4.2

2010-07-06 Thread David Yrueta
my base case the function should return a list of words but before returned a single word. Very good decision. Now take a close look at how you phrased the second condition. According to the design recipe, it should be structured to match the second condition of your data definition for list-of-

Re: [racket] [htdp] Help with Exercise 12.4.2

2010-07-06 Thread Sam Griff
> Exercise 12.4.2 is notorius. When looking to (list 'a 'b 'c), you should > exspect 6 distinct permutations. > Jos Thanks for your response but that really doesn't help me much. I'm focusing on insert-everywhere/in-single-word now. I understand what arrangements does and what permutations to expe

Re: [racket] [htdp] Help with Exercise 12.4.2

2010-07-06 Thread Matthias Felleisen
t 6 distinct permutations. Jos > -Original Message- > From: users-boun...@racket-lang.org > [mailto:users-boun...@racket-lang.org] On Behalf Of Sam Griff > Sent: 06 July 2010 20:00 > To: users@racket-lang.org > Subject: [racket] [htdp] Help with Exercise 12.4.2 > > H

Re: [racket] [htdp] Help with Exercise 12.4.2

2010-07-06 Thread David Yrueta
age- > > From: users-boun...@racket-lang.org > > [mailto:users-boun...@racket-lang.org] On Behalf Of Sam Griff > > Sent: 06 July 2010 20:00 > > To: users@racket-lang.org > > Subject: [racket] [htdp] Help with Exercise 12.4.2 > > > > Hello. Like many others working

Re: [racket] [htdp] Help with Exercise 12.4.2

2010-07-06 Thread Jos Koot
> To: users@racket-lang.org > Subject: [racket] [htdp] Help with Exercise 12.4.2 > > Hello. Like many others working through HtDP I have hit the > wall at this exercise. I'm not sure what I have so far is in > line with the "proper" way to do this exercise and

[racket] [htdp] Help with Exercise 12.4.2

2010-07-06 Thread Sam Griff
Hello. Like many others working through HtDP I have hit the wall at this exercise. I'm not sure what I have so far is in line with the "proper" way to do this exercise and would appreciate any help/suggestions. Here is the code I have so far: ;; A list of words is either ;; 1. empty ;; 2. (cons w