Currently the corto_value type allows describing any value in corto, but it does not describe how the value should be accessed. This is problematic when doing operations with values, like corto_value_binaryOp, as evaluation of a binary expression depends on how the operands should be evaluated.
A new field should be added to the corto_value type, which indicates how the value should be referenced. This field should be orthogonal to the existing corto_value type, in that specifying whether a value should be accessed by reference or by value does not affect how the value is stored inside the corto_value.
Currently the corto_value type supports two kinds for storing generic pointers (CORTO_VALUE and CORTO_MEM) where CORTO_VALUE means, look at the value type to determine how it should be referenced, and CORTO_MEM, which always references a pointer by value.
In the new design, these two kinds shall be replaced by CORTO_POINTER, and the new field shall determine whether the pointer should be referred to by value or by reference.
The new design shall support three reference kinds: BY_VALUE, BY_REFERENCE and BY_TYPE. The latter shall be used as default value, and uses the type to determine reference. This is equivalent to the old CORTO_VALUE kind.
Currently the
corto_value
type allows describing any value in corto, but it does not describe how the value should be accessed. This is problematic when doing operations with values, likecorto_value_binaryOp
, as evaluation of a binary expression depends on how the operands should be evaluated.A new field should be added to the
corto_value
type, which indicates how the value should be referenced. This field should be orthogonal to the existingcorto_value
type, in that specifying whether a value should be accessed by reference or by value does not affect how the value is stored inside thecorto_value
.Currently the
corto_value
type supports two kinds for storing generic pointers (CORTO_VALUE
andCORTO_MEM
) whereCORTO_VALUE
means, look at the value type to determine how it should be referenced, andCORTO_MEM
, which always references a pointer by value.In the new design, these two kinds shall be replaced by
CORTO_POINTER
, and the new field shall determine whether the pointer should be referred to by value or by reference.The new design shall support three reference kinds:
BY_VALUE
,BY_REFERENCE
andBY_TYPE
. The latter shall be used as default value, and uses the type to determine reference. This is equivalent to the oldCORTO_VALUE
kind.