public Node doEvaluation (Node[] arguments, Executor executor)
throws CALExecutorException {
// Evaluate the 3 arguments.
NRecordValue recordDict = (NRecordValue) executor.internalEvaluate(arguments[0]);
NValInt index = (NValInt) executor.internalEvaluate(arguments[1]);
NRecordValue recordValue = (NRecordValue) executor.internalEvaluate(arguments[2]);
int nFields = recordDict.getNFields();
List<String> fieldNames = recordDict.fieldNames();
NRecordValue result=new NRecordValue(nFields);
int nParams = recordValue.getNFields();
ArrayList<RecordParamHelper> paramSources = new ArrayList<RecordParamHelper>(nParams);
for(int i=0; i<nParams; i++) {
paramSources.add(RecordParamHelper.create(recordValue.getNthValue(i), executor));
}
for (int i = 0; i < nFields; ++i) {
Node fieldDict = recordDict.getNthValue(i);
Node elem;
if (index.getIntValue() == -1)
elem = fieldDict;
else
elem = fieldDict.apply(index);
//fill f's arguments using the param sources.