-
-
Notifications
You must be signed in to change notification settings - Fork 4
node
Data in Angle is node / map based.
The fundamental data type in Angle is a node, which may have a value or children, thus acting as list or map!
Just like how in lisp everything is a list, in angle everything is a map.
Or internally: a node with internal kind, parent, children and values.
Peter{address="Home 1"}
is internally represented as
Node{
name="Peter"
children={
Node{
name="address "
value=Node{
name="Home 1"
type=string
}
}
}
Nodes acting as lists and maps simultaneously may feel a bit unfamiliar for developers of other languages but it becomes natural after a while:
{a:b c:d} => a(value:b next:c(value:d))
The value property can hold many different types and will soon be unified with the children property:
{a{b c} d:e} => a(children:[b c] next:d(value:e)) =>
{a{b c} d:e} => a(value:(b next:c) next:d(value:e))