static private Binding copyProject(VarExprList vars, Binding binding, ExecutionContext execCxt) { // No group vars (implicit or explicit) => working on whole result set. // Still need a BindingMap to assign to later. Binding x = new BindingMap() ; for ( Iterator<Var> iter = vars.getVars().iterator() ; iter.hasNext() ; ) { Var var = iter.next() ; Node node = vars.get(var, binding, execCxt) ; // Null returned for unbound and error. if ( node != null ) x.add(var, node) ; } return x ; } }
static private Binding copyProject(VarExprList vars, Binding binding, ExecutionContext execCxt) { // No group vars (implicit or explicit) => working on whole result set. // Still need a BindingMap to assign to later. BindingMap x = BindingFactory.create() ; for ( Iterator<Var> iter = vars.getVars().iterator() ; iter.hasNext() ; ) { Var var = iter.next() ; Node node = vars.get(var, binding, execCxt) ; // Null returned for unbound and error. if ( node != null ) x.add(var, node) ; } return x ; } }
@Override public Binding accept(Binding binding) { Binding b = new BindingMap(binding) ; for ( Var v : exprs.getVars() ) { // Not this, where expressions do not see the new bindings. // Node n = exprs.get(v, bind, funcEnv) ; // which gives (Lisp) "let" semantics, not "let*" semantics Node n = exprs.get(v, b, getExecContext()) ; if ( n == null ) // Expression failed to evaluate - no assignment continue ; // Check is already has a value; if so, must be sameValueAs if ( b.contains(v) ) { Node n2 = b.get(v) ; if ( ! n2.sameValueAs(n) ) //throw new QueryExecException("Already set: "+v) ; // Error in single assignment. return null ; continue ; } b.add(v, n) ; } return b ; } }
Node n = exprs.get(v, b, getExecContext()) ;