Artifact 42196590cc953b0e8caf3cdccf4b6b3bfe9d34254b8f21e54236bb1acce27712:
- File typeparse/exemples/tcllib_geometry/geom_types.h — part of check-in [2ce9df4c51] at 2026-11-05 13:22:58 on branch tip-764_tcl90 — v16r 1. Typed procedures: added syntax for configuring the unfolding of product and sum types: the prefix {*} applied to a type unfolds it into a list: ``` proc {{*}vector}h {h} {(0,$h)}; h 100 ; # {0 100} ``` the prefix {**} applied to a type unfolds it into a dict: ``` proc {{**}vector}h {h} {(0,$h)}; h 100 ; # {x 0 y 100} ``` This unfolding occurs recursively (deeply). 2. Example: the `math::geometry` package, reformulated using the types and expressions from TIP 759. (user: Florentis, size: 774) [annotate] [blame] [check-ins using]
/* Produit par type {c!}export : little-endian, pointeurs de 8 octets. Ne pas modifier : regénérer. */ #include <stdint.h> #include <stddef.h> /* point */ typedef struct { double x; double y; } point; _Static_assert(sizeof(point) == 16, "point: size"); _Static_assert(offsetof(point, x) == 0, "point.x: offset"); _Static_assert(offsetof(point, y) == 8, "point.y: offset"); /* line */ typedef struct { double x1; double y1; double x2; double y2; } line; _Static_assert(sizeof(line) == 32, "line: size"); _Static_assert(offsetof(line, x1) == 0, "line.x1: offset"); _Static_assert(offsetof(line, y1) == 8, "line.y1: offset"); _Static_assert(offsetof(line, x2) == 16, "line.x2: offset"); _Static_assert(offsetof(line, y2) == 24, "line.y2: offset");