From: Keats <ke...@su...> - 2003-07-30 23:51:03
|
I'm busily refactoring the function stuff and I suddenly realized that all I had to do was make FunctionCall implement Macro and everything becomes a lot simpler. The FunctionCall.eval() takes care of almost everything, so Context.internalGet() becomes real simple. See below. The only real function code left in Context is keeping track of local functions. I'm wondering if anybody even cares about local functions. They could be pretty powerful but maybe it's not worth it. We'll have to discuss this later. I hope to test and commit by week's end ... Keats ==================================================== protected Object internalGet (Object name) { Object ret = _variables.get(name); if (ret == null && !_variables.containsKey(name)){ // not found in context. Check for auto-loading variable. if (name instanceof String) { Object var = _broker.getAutoContextVariable((String)name, this); if (var != null) { // auto-loading variable loaded. Add to context. put(name, var); ret = var; } } else if (name instanceof FunctionCall) ret = name; else ret = UNDEF; } return ret; } ======================================== |