This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (define (mceval exp env) | |
| (cond ((self-evaluating? exp) exp) | |
| ((variable? exp) (lookup-variable-value exp env)) | |
| ((quoted? exp) (text-of-quotation exp)) | |
| ((assignment? exp) (eval-assignment exp env)) | |
| ((definition? exp) (eval-definition exp env)) | |
| ((if? exp) (eval-if exp env)) | |
| ((lambda? exp) | |
| (make-procedure (lambda-parameters exp) | |
| (lambda-body exp) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String.prototype.fixSpaces = function () { | |
| return this.replace(/\s+/g, ' ').trim(); | |
| }; | |
| var Symbol = String; | |
| function tokenize(s) { | |
| return s.replace(/([()])/g, ' $1 ').fixSpaces().split(' '); | |
| }; |
NewerOlder