• Write down a contract and a purpose statement for the program that translates a Message into a String:

    Solution [PT 1]

    ;; message2string : Message -> String 
    ;; translate an message into a string 
    

  • Write down three function examples as tests (one per clause) for the function message-count, which counts how many characters are contained in all strings associated with a given Message.

    Solution [PT 1]

    (= (message-count 'hello) 0)
    (= (message-count "world") 5)
    (= (message-count (make-message 5 "a")) 1)