From: Geoffrey K. <ge...@kn...> - 2004-07-09 16:23:00
|
On Jul 9, 2004, at 10:36, Ken Anderson wrote: > Q1`: > In src/jsint/Evaluator.java: > public DynamicEnvironment INTERACTION_ENVIRONMENT > > Should this be static final, or should it be named > interactionEnvironment? Would anyone ever override/replace the interaction environment? If yes, I vote the latter. If no, I vote the former. > Q2: analyze() > line 265: > return new DynamicVariable((Symbol)x, dynamicEnv); > This returns a new DynamicVariable for each use of a symbol in the > body. > Shouldn't it reuse one if there is one already like Symbol.intern()? > Though that might require a synchronized method. By DynamicVariable I assume you mean a variable of local scope. If that is true, then I think you'd want a new one for each new binding, as opposed to each use. The word "dynamic" is a bit confusing to me, because it means one thing in the context of C or Java, another thing in Common Lisp. And here we are talking about a Scheme written in Java. Symbol.intern() -- wouldn't that let you have only one "x", instead of one at the top-level (global scope) and each lower local scope? Or, in the case of (define x 1) (let ((x 2)) ...), are the two x's guaranteed to have different Symbols, interned separately? Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk |