representing layout as a tree:
JSX
:
<button onClick={onClick}>
{text}
</button>
["button", { onClick }, text]
representing CAD as a tree
<Union>
<Path closed={true}>
<Point x={0} y={0} />
<Point x={10} y={20} />
<Point x={10} y={30} />
<Point x={9} y={42} />
</Path>
<Circle r={10} x={0} y={0}/>
</Union>
notice that parents impact children: Union
calculates over Path
and Circle
, in "normal" code representation that would be:
union(
path({ closed: true, points }),
circle({ r: 10, x: 0, y: 0 })
)
["intersection", [
["box", { s: [0.1, 0.1, 0.1] }],
translatedSphere([0.15, 0, 0], 0.2),
]]
representing code as a "tree" gives us a way to create UIs close to visual tools:
alpha={0}
representing as a DAG (nodes and edges):
+->B->E-+
| |
A +->F->G
| |
+->C->D-+
represented as a tree:
A
+ B
| + E
| + F
| + G
+ C
+ D
+ F
+ G
F
depends on E
and D
- this is used in Makefiles
for example242 words last tended to on 2021-01-17 — let me know what you think