summaryrefslogtreecommitdiff
path: root/examples/03-struct-generic/src/point.hob
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2026-08-10 17:39:13 +0100
committerMichael Williamson <mike@zwobble.org>2026-08-10 17:39:13 +0100
commit5613f3417aa766041fe1a91d27861f08d0facba9 (patch)
tree2734b41c89075d3b297017b775176cf0b7fb4188 /examples/03-struct-generic/src/point.hob
parent29dba03d9b65f3c1b9bd235ec5a7f41631fab2be (diff)
Fix creation of arbitrary constructed struct values
Diffstat (limited to 'examples/03-struct-generic/src/point.hob')
-rw-r--r--examples/03-struct-generic/src/point.hob12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/03-struct-generic/src/point.hob b/examples/03-struct-generic/src/point.hob
index ec6d76e..5beed86 100644
--- a/examples/03-struct-generic/src/point.hob
+++ b/examples/03-struct-generic/src/point.hob
@@ -1,3 +1,9 @@
+/// A set of drawings.
+struct OwnedLineDrawing[TPoint] {
+ field drawing: LineDrawing[TPoint];
+ field owner: String;
+}
+
/// A 2D drawing made up of straight lines.
struct LineDrawing2D {
field lines: List[Line[Point2D]];
@@ -8,6 +14,12 @@ struct LineDrawing[TPoint] {
field lines: List[Line[TPoint]];
}
+/// A cubic Bezier curve.
+struct BezierCurve[TPoint] {
+ field start: Line[TPoint];
+ field end: Line[TPoint];
+}
+
/// A straight line from one point to another.
struct Line[TPoint] {
field start: TPoint;