正在加载图片...
lecture and in the textbook. Because this evaluator is built on top of the underlying Scheme evaluator, we have called the procedure that executes evaluation m-eval(with associated m-apply) to distinguish it from the normal You should look through these files to get a sense for how they implement a version of the evaluator discussed in lecture(especially the procedure m-eval) You will be both adding code to the evaluator, and using the evaluator be careful, because it is easy to get confused. Here are some things to keep in mind: When adding code to be used as part of meval. scm, you are writing in Scheme, and can use any and all of the procedures of Scheme Changes you make to the evaluator are changes in defining the behavior you want your new evaluator to have After loading the evaluator(i.e, loading the file meval scm and any additions or modifications you make), you start it by typing(drive loop). In order to help you avoid confusion, weve arranged that each driver loop will print prompts on input and output to identify which evaluator you are typing at. For example, ;i M-Eval input (+34) M-Eval value shows an interaction with the m-eval evaluator To evaluate an expression, you type the expression and press ctrl-x ctrl-e. Dont use M-z to evaluate the expression; the presence of the prompt confuses the M-z mechanism. Also notice that if you have started up the evaluator in a scheme*buffer, you may go to any other buffer, write definitions or expressions and evaluate them from that buffer. This will cause the expressions to be evaluated in the new evaluator. On the other hand, if you have not started up the evaluator, evaluating expressions from a buffer will cause them to be evaluated in the normal Scheme evaluator The evaluator with which you are working does not include an error system If you hit an error you will bounce back into ordinary Scheme. You can restart the driver-loop by running the procedure driver-loop. Note that the driver loop does not re-initialize the environment, so any definitions you have made should still be available if you have to re-run driver n case you do want a clean environment, you should evaluate (refresh-global-environment) while in normal Scheme. It is instructive to run the interpreter while tracing m-eval (You will also probably need to do this while debugging your code for this assignment.7 lecture and in the textbook. Because this evaluator is built on top of the underlying Scheme evaluator, we have called the procedure that executes evaluation m-eval (with associated m-apply) to distinguish it from the normal eval. You should look through these files to get a sense for how they implement a version of the evaluator discussed in lecture (especially the procedure m-eval). You will be both adding code to the evaluator, and using the evaluator. Be careful, because it is easy to get confused. Here are some things to keep in mind: When adding code to be used as part of meval.scm, you are writing in Scheme, and can use any and all of the procedures of Scheme. Changes you make to the evaluator are changes in defining the behavior you want your new evaluator to have. After loading the evaluator (i.e., loading the file meval.scm and any additions or modifications you make), you start it by typing (driver￾loop). In order to help you avoid confusion, we've arranged that each driver loop will print prompts on input and output to identify which evaluator you are typing at. For example, ;;; M-Eval input: (+ 3 4) ;;; M-Eval value: shows an interaction with the m-eval evaluator. To evaluate an expression, you type the expression and press ctrl-x ctrl-e. Don't use M-z to evaluate the expression; the presence of the prompt confuses the M-z mechanism. Also notice that if you have started up the evaluator in a *scheme* buffer, you may go to any other buffer, write definitions or expressions and evaluate them from that buffer. This will cause the expressions to be evaluated in the new evaluator. On the other hand, if you have not started up the evaluator, evaluating expressions from a buffer will cause them to be evaluated in the normal Scheme evaluator. The evaluator with which you are working does not include an error system. If you hit an error you will bounce back into ordinary Scheme. You can restart the driver-loop by running the procedure driver-loop. Note that the driver loop does not re-initialize the environment, so any definitions you have made should still be available if you have to re-run driver￾loop. In case you do want a clean environment, you should evaluate (refresh-global-environment) while in normal Scheme. It is instructive to run the interpreter while tracing m-eval. (You will also probably need to do this while debugging your code for this assignment.)
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有