Package org.openquark.cal.runtime

Examples of org.openquark.cal.runtime.RecordValue


        NRecordValue x = (NRecordValue) executor.internalEvaluate(arguments[1]);
       
        List<String> fieldNames = recordDictionary.fieldNames();       
        int nFields = fieldNames.size();
       
        RecordValue resultMap = RecordValueImpl.make();
        for (int i = 0; i < nFields; ++i) {
           
            String fieldName = fieldNames.get(i);
            Node valueDictionaryThunk = recordDictionary.getValue(fieldName);
            Node xValueThunk = x.getValue(fieldName);           
           
            //compute "Prelude.output valueDictionaryThunk xValueThunk"
            //this is just (after inlining Prelude.output d = d"
            //valueDictionaryThunk xValueThunk
           
            Object fieldVal = executor.internalEvaluate(valueDictionaryThunk.apply (xValueThunk)).getValue();
            resultMap.put(FieldName.make(fieldName), fieldVal);
        }
       
        return new NValObject(resultMap);
       
    }
View Full Code Here


        //the value x.f.

        final RTRecordValue recordDict = (RTRecordValue)recordDictionary;
        final RTRecordValue xRecord = (RTRecordValue)x;

        final RecordValue resultMap = RecordValueImpl.make();
        final int nFields = recordDict.getNFields();

        for (int i = 0; i < nFields; ++i) {
            final FieldName fieldName = recordDict.getNthFieldName(i);
            //RTValue fieldDict = recordDictionary.getNthValue(i);
            //RTValue xField = xRecord.getNthValue(i);

            //compute "Prelude.output fieldDict xField"
            //this is just (after inlining Prelude.output d = d"
            //fieldDict xField
            final Object fieldValue = recordDict.getNthValue(i).apply(xRecord.getNthValue(i)).evaluate($ec).getOpaqueValue();
            resultMap.put(fieldName, fieldValue);
        }

        return resultMap;
    }
View Full Code Here

TOP

Related Classes of org.openquark.cal.runtime.RecordValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.