6 Lab My First Language
Goals |
— |
Exercise 12. Change "arith.rkt" to allow literal booleans—
#false, #true, #f, and #t— in the same way that literal numbers and strings are allowed.
You can use a #:datum-literals clause in syntax-parse to support then and else. But after you get that working, make #:literals work, which will involve defining then and else as macros that always complain if they are used outisde of teir designated positions in if, like else in racket.
Exercise 14. Make the define-function language a proper language as implemented by a "algebra.rkt" module. Allow just the forms in the grammar—
nothing more, nothing less.
Exercise 15. Add 17 additional primitive arithmetic operators to "algebra.rkt". Don’t wear out your copy-and-paste keys by making 17 copies of the definition of plus.