Currently, a Value which holds a ModelNode always evaluates to false, because the Value::field() ctor requires an existing value which is always null for for objects/arrays. This leads to some confusion, because myModel.objectNode is never true and trace(myModel.objectNode) always returns null. The only way to evaluate a compound member as true is through the exists-operator, but that seems like an unnecessary constraint.
The Value can also assume an Object state. Maybe we can replace Object with ModelNodePtr? Then ObjectModelNode::value() wouldn't need to return null anymore, and the ::field ctor can be removed. We can give the ModelNode interface a meta() function to unify Object and ModelNode.
Currently, a
Value
which holds aModelNode
always evaluates to false, because theValue::field()
ctor requires an existing value which is always null for for objects/arrays. This leads to some confusion, becausemyModel.objectNode
is never true andtrace(myModel.objectNode)
always returnsnull
. The only way to evaluate a compound member as true is through theexists
-operator, but that seems like an unnecessary constraint.The
Value
can also assume anObject
state. Maybe we can replaceObject
withModelNodePtr
? ThenObjectModelNode::value()
wouldn't need to returnnull
anymore, and the::field
ctor can be removed. We can give theModelNode
interface ameta()
function to unifyObject
andModelNode
.