--- /dev/null
+#lang racket
+
+#|
+
+The assignment for example can be changed from 'set!' to 'setq' for instance.
+Only the leaf functions which checks for the type tag needs to be changed.
+
+|#
\ No newline at end of file
--- /dev/null
+#lang racket
+
+(define (make-frame variables values)
+ (if (not (= (length variables)
+ (length values)))
+ (error "Number of variables and values should be the same -- MAKE-FRAME")
+ (map cons variables values)))
+
+(define (frame-variables frame)
+ (map car frame))
+
+(define (frame-values frame)
+ (map cdr frame))
+
+(define (add-binding-to-frame! var val frame)
+ (set! frame (cons (cons var val) frame)))
--- /dev/null
+#lang racket
+
+;; 4.9
+#|
+
+do, for, while, until, when
+
+a. for
+
+(for <var> in <seq>
+ <body>)
+
+bind var with each value in sequence, execute the <body> and
+collect the result of the last expression into a list.
+
+b. (dotimes n <number>
+ <body>)
+
+Bind n to the number and execute the body that many times for
+side effects.
+
+c. (while <predicate>
+ <body>)
+
+Check the value of the predicate, if true, execute the body,
+check the predicate again until it is false, in which case,
+stop executing the body.
+
+|#
+
+#| implementation:
+
+Derived expressions can be used to implement all the above
+constructs. For example, 'for' can be implementing by transforming
+the body into an iterative procedure. 'dotimes' is similar and
+simpler. 'while' can be implemented using recursive procedure
+and 'if'.
+
+|#
+