[racket] arrangements exercise

From: Sean Kemplay (sean.kemplay at gmail.com)
Date: Sat Jul 7 07:18:01 EDT 2012

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 <matthias at ccs.neu.edu> wrote:
>
> 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 to '2e' if I were you. It's more fun but you will learn
> mostly the same ideas. ('2e' provides an event-driven program context as
> playground for developing design skills. '1e' provides no real context.)
>
>
> Do you mean the contract for insert-everywhere/word should be symbol word ->
> list of words? And will the words returned be the same length? Ie am I
> aiming for the same result as the current definition?
>
>
> Letter List-of-Words -> List-of-Words
> insert letter l in all positions in all words in lw
>
> (define (insert-everywhere/all-words l lw)
>   lw)
>
>
> Letter Word -> List-of-Words
> insert letter l in all positions in one word (w)
>
> (define (insert-everywhere/1word l w)
>   (list w))
>
> ;; ---
>
> I recommend you make up examples (with check-expect) first and send them
> back to the list.
> The above 'stub' implementations should fail most of your examples. (A
> stub/silly/stupid/obviously-wrong
> implementation is something '2e' suggests.)
>
>
>
>

Posted on the users mailing list.