mbeckerle commented on a change in pull request #369:
URL: https://github.com/apache/incubator-daffodil/pull/369#discussion_r413258016



##########
File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/VariableMap1.scala
##########
@@ -53,28 +54,54 @@ case object VariableRead extends VariableState
 case object VariableInProcess extends VariableState
 
 /**
- * Core tuple of a pure functional "state" for variables.
+ * Core tuple of a "state" for variables.
  */
-case class Variable(state: VariableState, value: DataValuePrimitiveNullable, 
rd: VariableRuntimeData, defaultValueExpr: Maybe[CompiledExpression[AnyRef]]) 
extends Serializable
+case class Variable(
+  var state: VariableState,
+  var value: DataValuePrimitiveNullable,
+  rd: VariableRuntimeData,
+  defaultValueExpr: Maybe[CompiledExpression[AnyRef]],
+  var priorState: VariableState = VariableUndefined,
+  var priorValue: DataValuePrimitiveNullable = DataValue.NoValue)
+  extends Serializable {
+
+  def copy(
+    state: VariableState = state,
+    value: DataValuePrimitiveNullable = value,
+    rd: VariableRuntimeData = rd,
+    defaultValueExpr: Maybe[CompiledExpression[AnyRef]] = defaultValueExpr,
+    priorState: VariableState = priorState,
+    priorValue: DataValuePrimitiveNullable = priorValue) =
+      new Variable(state, value, rd, defaultValueExpr, priorState, priorValue)

Review comment:
       Some of the slots are mutable. Can't have a var in a case class I 
believe. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to