NRecordValue recordDictionary = (NRecordValue) executor.internalEvaluate(arguments[0]);
List<?> inputList = (List<?>)((NValObject)executor.internalEvaluate(arguments[1])).getValue();
//we use an iterator since inputList may be a non-random access list such as a java.util.LinkedList.
Iterator<?> inputListIterator = inputList.iterator();
List<String> fieldNames = recordDictionary.fieldNames();
int nFields = fieldNames.size();
//check that the number of fields in the inputList is the same as the number of fields in the record.
//without this check it is possible that inputList could have more elements than the size of the record and still succeed.
//This would still "work" but this check is useful to alert clients to potential bugs in their code.