From: Ken A. <kan...@bb...> - 2004-03-11 22:29:14
|
OK, since you've got 3 or 4 votes for your proposal, and none against, give it a shot. Why don't you email Tim and i as you do it, for guidence. What i'd do is copy jsint.Scheme into either jsint.REPL or jsint.Evaluator. make most of the static fields non static ... Then get jscheme.REPL to use it rather than jsint.Scheme in main(). Maybe we'll just get rid of Scheme eventually. In fact, remove it and let the compiler tell you where you need to change the code. Scheme.ARGS only makes sense for the first Evaluator. So it should just become a global variable on the Scheme side. What arguments should the constructor take? Probably a DynamicEnvironment at least optionally, but probably also the input, output, and error. Try to avoid setter methods, we want to think functionally when we can. The jscheme.JS class that interfaces from Java to Scheme will need to be changed. For now, have that class create a static final instance to use to keep the code simple. This may be a good tern of events because it may guide us into some good refactorings. For example, i've thought that the REPL (Read Eval Print Loop) could be split up. The E would be an object that too s-expressions and returned their value. It could be attached in the usual REPL way or it could be controled by a GUI that passed commands to it as the user clicked on things and updated the screen accordinly. Also, i once made eval and load replaceable procedures, so for example you could get R5RS macros. But that disappeared when Tim put in DynamicEnvironments. k |