Beginner
Every wire in Phograph carries a value. This lesson covers the data types you can work with and how to create constant values.
Phograph is dynamically typed — you don’t declare types in advance. The engine figures out types at runtime. Here are the most common types:
| Type | Examples | Description |
|---|---|---|
| Integer | 0, 42, -7 | Whole numbers (64-bit signed) |
| Real | 3.14, -0.5 | Floating-point (64-bit double) |
| String | "hello" | UTF-8 text |
| Boolean | true, false | Logical values |
| List | (1 2 3) | Ordered collection |
| Null | null | Absence of a value |
There are more (Dict, Data, Date, Object, Error, Enum, External), but these six cover most programs. We’ll meet the others in later lessons.
A constant node has no input pins and one output pin. It produces a fixed value every time it fires. The value is shown as the node’s label.
To add a constant: right-click the canvas and choose Constant. Then select the node and edit its value in the Inspector.
An output pin can have multiple wires leaving it. The value is copied to each destination. This is called fan-out.
The constant 5 is delivered to three different nodes simultaneously.
An input pin accepts at most one wire. If you need to combine two values,
use a primitive like + or concat to merge them first.
inspect is like log, but it also passes through
its input as output. This lets you see a value without breaking the data flow.
main with 0 inputs and 0 outputs.10, 20, and 30.log nodes and wire each constant to one log."echo".log nodes (two wires from one output pin).inspect node between the + node’s output and the * node’s input.
(Delete the existing wire, then wire + → inspect → *.)[inspect] 7 (the intermediate sum) and the final result 14.inspect logs a value and passes it through.