Assignment 7 FAQs and More

FAQs

  1. Q: If ruler.rkt can't contain #, what do I do about the #lang racket line?

    A: Oops—instead of searching my solution I'd only eyeballed it, and overlooked the # in #lang!

    I'm going to stick with my restrictions and use this an opportunity to show you something new. The #lang line is actually a shorthand for a module declaration, so for ruler.rkt, just use the module special form instead. Your ruler.rkt should look something like this:

    % cat ruler.rkt
    (module ruler racket
        (provide ruler)
    
        (define (ruler n)
            ...forms for ruler...)
    )
    
    

    Corrections/Clarifications (fixed in copy on website)

    1. For unary.rkt:
      1. Assume the argument for decimal->unary is non-negative.
      2. The table entry for unary-sub had "If a > b ..." rather than "If a >= b ...".