Re: [racket] arrangements exercise

2012-07-12 Thread Sean Kemplay
Thanks Matthias for yet again looking at my attempt at this exercise! Agreed Stephen, yes the purpose statement is not as clear as it could be. Great list, great book, great software. Regards, Sean Kemplay On Thu, Jul 12, 2012 at 10:21 PM, Matthias Felleisen wrote: > > On Jul 12, 2012, at 5:1

Re: [racket] arrangements exercise

2012-07-12 Thread Matthias Felleisen
On Jul 12, 2012, at 5:14 PM, Stephen Bloch wrote: > The only quibble I would raise is with the purpose statement for "make-words": >> ;; make-words symbol list of words -> list of words >> ;; Given a symbol and a list of (partial) words, start >> ;; back filling with the symbol producing a new li

Re: [racket] arrangements exercise

2012-07-12 Thread Stephen Bloch
On Jul 12, 2012, at 4:40 PM, Sean Kemplay wrote: > Ok, here is another shot - this time, like arrangements, making a list > of words from the base case of insert-everywhere/in-all-words to feed > to make words. Lovely. Contracts and test cases for each function, each function does a clearly-sp

Re: [racket] arrangements exercise

2012-07-12 Thread Matthias Felleisen
Looking simple, elegant and correct. Onward -- Matthias Racket Users list: http://lists.racket-lang.org/users

Re: [racket] arrangements exercise

2012-07-12 Thread Sean Kemplay
Ok, here is another shot - this time, like arrangements, making a list of words from the base case of insert-everywhere/in-all-words to feed to make words. ;; Word -> [Listof Word] (check-expect (arrangements '(a)) (list '(a))) (check-expect (arrangements '(a b)) (list '(a b) '(b a))) (define (a

Re: [racket] arrangements exercise

2012-07-07 Thread Sean Kemplay
Thanks Matthias, I will go through 2e up until the arrangements exercise then make the examples to post to the list. Thank you for your time it is much appreciated. Sean On Fri, Jul 6, 2012 at 1:21 PM, Matthias Felleisen wrote: > > On Jul 6, 2012, at 5:48 AM, Sean Kemplay wrote: > > I am going

Re: [racket] arrangements exercise

2012-07-06 Thread Matthias Felleisen
On Jul 6, 2012, at 5:48 AM, Sean Kemplay wrote: > I am going through htdp first edition (at chapter 17 which refers to > arrangements from chapter 12 which is why I revisited the exercise). Would > you suggest continuing with this edition or moving to the draft second edition > I would switch

Re: [racket] arrangements exercise

2012-07-06 Thread Sean Kemplay
Hi Matthias, Thanks for the feedback. Just a couple of questions before I give it another go if that's okay. I know there is something I need to learn from this exercise. I am going through htdp first edition (at chapter 17 which refers to arrangements from chapter 12 which is why I revisited the

Re: [racket] arrangements exercise

2012-07-05 Thread Matthias Felleisen
Sean, 1. I have re-arranged your program so that it becomes readable: -- the function that explains it all comes first -- if you need a helper function, it is placed below -- don't place functions at top that are called by functions further down (roughly) -- make sure lines are at mo

Re: [racket] arrangements exercise

2012-07-05 Thread Sean Kemplay
On Mon, Jul 2, 2012 at 1:51 AM, Dave Yrueta wrote: > I should have been more explicit: "ensuring the function design conforms to > its contract" means testing it in the manner demonstrated by Matthias. > "Check-expect" is your friend :). > On Jul 1, 2012, at 4:12 PM, Matthias Felleisen wrote: >

Re: [racket] arrangements exercise

2012-07-02 Thread Sean Kemplay
Thank you all for your time and advice. I will start from scratch with this in mind and let you know how I get on. Sean On Jul 2, 2012 1:51 AM, "Dave Yrueta" wrote: > > I should have been more explicit: "ensuring the function design conforms to its contract" means testing it in the manner demon

Re: [racket] arrangements exercise

2012-07-01 Thread Dave Yrueta
I should have been more explicit: "ensuring the function design conforms to its contract" means testing it in the manner demonstrated by Matthias. "Check-expect" is your friend :). On Jul 1, 2012, at 4:12 PM, Matthias Felleisen wrote: > > On Jul 1, 2012, at 4:17 PM, Sean Kemplay wrote: > >>

Re: [racket] arrangements exercise

2012-07-01 Thread Matthias Felleisen
On Jul 1, 2012, at 4:17 PM, Sean Kemplay wrote: > Looking back, I am wondering if my solution is a bit of a cheat - > specifically : > > (define (insert-everwhere/in-one-word s word) > (make-words s word word)) It's not a cheat, it's wrong. I did you a favor and worked out a failing test ca

Re: [racket] arrangements exercise

2012-07-01 Thread Dave Yrueta
Hi Sean -- Don't know if it is a "cheat," but I can tell you from experience your solution diverges from the preferred one at the "insert-everywhere/in-one-word" function. Try working through this exercise by systematically applying the design recipe. That is, take the time to make your data

[racket] arrangements exercise

2012-07-01 Thread Sean Kemplay
Hello, I am working through HTDP and have re-visited the arrangements exercise from chapter 12. Looking back, I am wondering if my solution is a bit of a cheat - specifically : (define (insert-everwhere/in-one-word s word) (make-words s word word)) Here is the entire solution - is there a bet