You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the / character is used as scope operator to indicate parent-child relationships in object identifiers (foo/bar). The dot operator '.' is used to address fields inside an object (p.x).
In some cases, the practical difference between a field and a child object is small. One example is when using leaf objects in containers:
container Drone {
leaf on_off: type:bool
}
The on_off object will be created as a child object for every instance of Drone, and thus can now only be referred to as my_drone/on_off. Conceptually however, it is similar to a member in that the lifecycle of the leaf is coupled to its parent.
To enable applications to abstract away from the difference between fields and child objects, the dot operator should be made available as a "more capable" scope operator. An example of an object expression that uses dot notation:
foo.bar
The semantics of the dot operator shall be to first lookup bar as a field of foo. If the type of foo does not contain a member bar, bar shall be resolved in the scope of foo, if it is a named object.
In cases where an object both has a member called foo and a child object called foo, the dot operator shall resolve the member. To force corto to resolve the object, the regular / operator can be used.
The text was updated successfully, but these errors were encountered:
Currently, the
/
character is used as scope operator to indicate parent-child relationships in object identifiers (foo/bar
). The dot operator'.'
is used to address fields inside an object (p.x
).In some cases, the practical difference between a field and a child object is small. One example is when using leaf objects in containers:
The
on_off
object will be created as a child object for every instance of Drone, and thus can now only be referred to asmy_drone/on_off
. Conceptually however, it is similar to a member in that the lifecycle of the leaf is coupled to its parent.To enable applications to abstract away from the difference between fields and child objects, the dot operator should be made available as a "more capable" scope operator. An example of an object expression that uses dot notation:
The semantics of the dot operator shall be to first lookup
bar
as a field offoo
. If the type offoo
does not contain a memberbar
,bar
shall be resolved in the scope offoo
, if it is a named object.In cases where an object both has a member called
foo
and a child object calledfoo
, the dot operator shall resolve the member. To force corto to resolve the object, the regular/
operator can be used.The text was updated successfully, but these errors were encountered: