This section collects the exercises from Matthew F. Building Languages.
Exercise 39. Add a match clause (or several) to the new-lambda macro so that lambda shapes (trees) other than
(lambda (x:id) e:expr)behave as before. Note If you know more than basic Racket but not the whole language, just get some shapes to work—
not all of lambda.
Exercise 40. Adjust "noisy-lambda.rkt" to make define create noisy functions, too, when it’s used in function-shorthand mode—
like (define (f x) 11), as opposed to (define x 8) or (define f (lambda (x) 11)).
Exercise 43. Racket’s #%app implements left-to-right evaluation of function-call arguments. Change "noise-racket.rkt" so that it implements right-to-left evaluation of arguments to a function call. You’ll need to use Racket’s #%app to implement your new #%app.
Exercise 45. Some users of #lang noisy may miss DOS-style comments using REM. Adjust the reader so that it detects and discards an REM result, discarding the rest of the line as well, and then tries reading again. Use syntax? to detect a non-EOF result from read-syntax, and use read-line to consume (the rest of) a line from an input stream.
Start with the QL implementation. You can pick any of the QL variants as a starting point, but one with at least type checking will be the most interesting, and the one with non-S-expression syntax should be within reach.
Exercise 46. Add an if form for use in guards or expressions to compute field values.