2012年11月9日星期五

Project 1

Not as hard as I thought, but there still two things confuse me a lot

1 what is the code "map-image" really means?

2 for the check-key part,

(check-expect (check-key (make-clocktime 1 2 3 GO) "up") (make-clocktime 1 2 3 GO))
(check-expect (check-key (make-clocktime 1 2 3 GO) "down") (make-clocktime 1 2 3 STOP))


(define (check-key im k)
  (cond
    [(equal? k "down") STOP]
    [else im]))

I just cannot find a definition which could fit the two check-expect well
I think the reason is the make-clocktime and the GO sigh are bound together, represented by im. So I don't know how to change only one part of the whole item.
And I tried to define another function to help me solve this problem another way, but all the "placeholder" I tried to use was showed "not defined"...

Anyway, doing the project is a great way for me to prepare the term test  next week.  

2012年11月8日星期四

textbook is not that clear...

I think the textbook only give us a basic idea of deferent functions, but the exercise is much harder then what I learned from examples...
Also the textbook put the codes, definitions and some statements all together makes me really confuse about how the code working.
I believe if we can have more examples that will help us understand the code better.