Each node in a Luna graph corresponds to a line of Luna code. For example:
a = 1
b = 2
c = a + b
c.succ
Let's break this graph down:
- The two leftmost nodes correspond to the lines
a = 1
andb = 2
. The variable namesa
andb
become names of their corresponding nodes, and the numbers1
and2
are their definitions. They have no input ports and one output port each. - The node in the middle corresponds to the line
c = a + b
. It has thea
andb
nodes connected to its inputs. Thanks to this, you can clearly see where does the input data come from. - The rightmost node corresponds to the line
c.succ
. The node has no name, as the corresponding line does not define any variables. It has the nodec
connected to itsself
port. This port denotes the target of method call (more on different port types later).
TODO: NODE BREAKDOWN DIAGRAM