function argument(frame, sexp) {
        if(sexp==null)
            return null;
        else if(_.isString(sexp)) {
            // special-case simple string field access for efficiency
            if(/\.\..*\.\.$/.test(sexp)) {
                var content = sexp.substring(2, sexp.length-2);
                switch(content) {
                case 'value':
                case 'index': return frame.index;
                case 'key': return function(k, v) { return k; };
                default: throw "unknown special variable " + sexp;
                }
            }
            else if(frame.has(sexp))
                return frame.access(sexp);
            else return sexp;
        }
        else if(_.isNumber(sexp))
            return sexp;
        else if(_.isArray(sexp) && sexp[0]==='c')
            return sexp.slice(1);
        var ctx = {indent:0};
        var js_expr = expression(frame, sexp, ctx);
        if(js_expr.lambda) {
            // it seems kind of screwy to use eval here but it has the nice property
            // of using a closure, which new Function() does not, which makes it
            // easier to inspect the js_expr in the debugger (without _.partial()
            // getting in the way, etc.)
            return function(key,value) { return eval(js_expr.text); };
        }
        else {
            // the expression didn't involve any variables, so we can execute it now
            return eval(js_expr.text);
        }
    }
/* a wdcplot argument may be
     - null
     - a simple field accessor (if it's a string which is a field name in the dataframe)
     - a string (if it's any other string)
     - a number
     - an array (we assume any top-level array contains only literals)
     - otherwise we build javascript from the expression tree; if it contains
     field names identifiers, it's a lambda(key,value) else execute it immediately
     */
a wdcplot argument may be
null
a simple field accessor (if it's a string which is a field name in the dataframe)
a string (if it's any other string)
a number
an array (we assume any top-level array contains only literals)
otherwise we build javascript from the expression tree; if it contains
field names identifiers, it's a lambda(key,value) else execute it immediately
a wdcplot argument may be null a simple field accessor ( if it ' s a string which is a field name in the dataframe ) a string ( if it ' s any other string ) a number an array ( we assume any top - level array contains only literals ) otherwise we build javascript from the expression tree ; if it contains field names identifiers it ' s a lambda ( key value ) else execute it immediately
function argument(frame, sexp) {
        if(sexp==null)
            return null;
        else if(_.isString(sexp)) {
            if(/\.\..*\.\.$/.test(sexp)) {
                var content = sexp.substring(2, sexp.length-2);
                switch(content) {
                case 'value':
                case 'index': return frame.index;
                case 'key': return function(k, v) { return k; };
                default: throw "unknown special variable " + sexp;
                }
            }
            else if(frame.has(sexp))
                return frame.access(sexp);
            else return sexp;
        }
        else if(_.isNumber(sexp))
            return sexp;
        else if(_.isArray(sexp) && sexp[0]==='c')
            return sexp.slice(1);
        var ctx = {indent:0};
        var js_expr = expression(frame, sexp, ctx);
        if(js_expr.lambda) {
            return function(key,value) { return eval(js_expr.text); };
        }
        else {
            return eval(js_expr.text);
        }
    }
function argument ( frame , sexp ) { if ( sexp == null ) return null ; else if ( _ . isString ( sexp ) ) { if ( / \.\..*\.\.$ / . test ( sexp ) ) { var content = sexp . substring ( 2 , sexp . length - 2 ) ; switch ( content ) { case 'value' : case 'index' : return frame . index ; case 'key' : return function ( k , v ) { return k ; } ; default : throw "unknown special variable " + sexp ; } } else if ( frame . has ( sexp ) ) return frame . access ( sexp ) ; else return sexp ; } else if ( _ . isNumber ( sexp ) ) return sexp ; else if ( _ . isArray ( sexp ) && sexp [ 0 ] === 'c' ) return sexp . slice ( 1 ) ; var ctx = { indent : 0 } ; var js_expr = expression ( frame , sexp , ctx ) ; if ( js_expr . lambda ) { return function ( key , value ) { return eval ( js_expr . text ) ; } ; } else { return eval ( js_expr . text ) ; } }
a wdcplot argument may be
 null
 a simple field accessor (if it's a string which is a field name in the dataframe)
 a string (if it's any other string)
 a number
 an array (we assume any top-level array contains only literals)
 otherwise we build javascript from the expression tree; if it contains
field names identifiers, it's a lambda(key,value) else execute it immediately
a wdcplot argument may be null a simple field accessor ( if it ' s a string which is a field name in the dataframe ) a string ( if it ' s any other string ) a number an array ( we assume any top - level array contains only literals ) otherwise we build javascript from the expression tree ; if it contains field names identifiers it ' s a lambda ( key value ) else execute it immediately
// special-case simple string field access for efficiency // it seems kind of screwy to use eval here but it has the nice property // of using a closure, which new Function() does not, which makes it // easier to inspect the js_expr in the debugger (without _.partial() // getting in the way, etc.) // the expression didn't involve any variables, so we can execute it now