Extension 1 may be completed at any stage of the final project.
Final project due Monday, May 8 at noon
The extensions are intended to serve three purposes; they will:
You may attempt to complete the extensions at any point during the project. You do not need to attempt them after a specific required portion of the project.
Finally, since these extensions are considered "advanced" features, you will receive far less guidance in completing them then you will receive for the required portions of the project. This does not mean that you cannot ask questions; rather, I will provide less information to you up front, forcing you to work out details on your own.
Since you have completed Part 2, your interpreter can already evaluate quoted expressions. In this extension, you will implement quasiquote and unquote. You may want to read the Help Desk for further information on these special forms.
Here are a few brief details about quasiquote and unquote:
Here are some interactions in Scheme:
> (define a 3) > (define b 4) > ,a ; rule 3 unquote: not in quasiquote in: (unquote b) > '(+ a b) (+ a b) > `(+ a b) ; rule 4 (+ a b) > `(+ ,a ,b) ; rule 5 (+ 3 4) > `(+ `(+ ,a ,b) ,b) ; rule 6 (+ `(+ ,a ,b) 4) > `,`,`,a 3Be sure you try other combinations to make sure you understand how quasiquote and unquote work.
To implement a simple syntax checker, you will write two new functions, (tagged-list-length-n? exp tag n) and (tagged-list-min-length-n? exp tag n):
By replacing your calls to tagged-list? with calls to tagged-list-length-n? or tagged-list-min-length-n?, your interpreter will be able to catch many simple syntax errors.
Remember that as you complete future parts of the interpreter, you will want to continue to use these length-verifying tagged-list? variants instead of the original tagged-list? procedure.