> For the complete documentation index, see [llms.txt](https://docs.luna-lang.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.luna-lang.org/luna-user-guide/visual_representation/switching_representations.md).

# Switching between representations

Luna delivers a mechanism for the two way translation between visual and textual representations. It allows you to switch the representation on demand and even work on both of them at the same time. The implementation details are beyond the scope of this book, however, from the high perspective the translation is a straightforward process.

In the most common case, each Luna node corresponds to a line of code. For example:

![](/files/-LdNvwoUk6TxE1hwxcSU)

```python
a = 1
b = 2
c = a + b
c.succ
```

Let's break this graph down:

1. The two leftmost nodes correspond to the lines `a = 1` and `b = 2`. The variable names `a` and `b` become names of their corresponding nodes, and the numbers `1` and `2` are their definitions. They have no input ports and one output port each.
2. The node in the middle corresponds to the line `c = a + b`. It has the `a` and `b` nodes connected to its inputs. Thanks to this, you can clearly see where does the input data come from.
3. 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 node `c` connected to its `self` port. This port denotes the target of method call.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.luna-lang.org/luna-user-guide/visual_representation/switching_representations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
