nomen-lang 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/audit_runtime.c +12 -2
  2. package/core/System/Arena.nm +14 -5
  3. package/core/System/Array.nm +1 -1
  4. package/core/System/Atomic.nm +3 -3
  5. package/core/System/BigInt.nm +182 -23
  6. package/core/System/Buffer.nm +392 -33
  7. package/core/System/ClassBuffer.nm +145 -13
  8. package/core/System/Controls/Alert.nm +3 -3
  9. package/core/System/Controls/App.nm +17 -17
  10. package/core/System/Controls/Button.nm +2 -2
  11. package/core/System/Controls/CheckBox.nm +3 -3
  12. package/core/System/Controls/ColorPicker.nm +2 -2
  13. package/core/System/Controls/ComboBox.nm +2 -2
  14. package/core/System/Controls/Container.nm +39 -33
  15. package/core/System/Controls/DatePicker.nm +1 -1
  16. package/core/System/Controls/Form.nm +2 -2
  17. package/core/System/Controls/GroupBox.nm +2 -2
  18. package/core/System/Controls/ImageView.nm +2 -2
  19. package/core/System/Controls/Layout.nm +5 -5
  20. package/core/System/Controls/LevelIndicator.nm +2 -2
  21. package/core/System/Controls/ListView.nm +2 -2
  22. package/core/System/Controls/Menu.nm +2 -2
  23. package/core/System/Controls/NumberInput.nm +3 -3
  24. package/core/System/Controls/OtpInput.nm +2 -2
  25. package/core/System/Controls/OutlineView.nm +2 -2
  26. package/core/System/Controls/Pagination.nm +14 -14
  27. package/core/System/Controls/Popover.nm +2 -2
  28. package/core/System/Controls/Progress.nm +2 -2
  29. package/core/System/Controls/Radio.nm +3 -3
  30. package/core/System/Controls/Scrollable.nm +1 -1
  31. package/core/System/Controls/SearchField.nm +2 -2
  32. package/core/System/Controls/SecureField.nm +2 -2
  33. package/core/System/Controls/Segmented.nm +2 -2
  34. package/core/System/Controls/Select.nm +2 -2
  35. package/core/System/Controls/Separator.nm +2 -2
  36. package/core/System/Controls/Sheet.nm +2 -2
  37. package/core/System/Controls/Slider.nm +2 -2
  38. package/core/System/Controls/Spinner.nm +5 -5
  39. package/core/System/Controls/SplitView.nm +3 -3
  40. package/core/System/Controls/Stepper.nm +2 -2
  41. package/core/System/Controls/Switch.nm +2 -2
  42. package/core/System/Controls/Table.nm +2 -2
  43. package/core/System/Controls/Tabs.nm +2 -2
  44. package/core/System/Controls/Text.nm +2 -2
  45. package/core/System/Controls/TextBox.nm +3 -3
  46. package/core/System/Controls/TextView.nm +2 -2
  47. package/core/System/Controls/Toggle.nm +3 -3
  48. package/core/System/Controls/Toolbar.nm +2 -2
  49. package/core/System/Controls/Window.nm +12 -5
  50. package/core/System/Fiber.nm +16 -3
  51. package/core/System/Graph.nm +2 -2
  52. package/core/System/LinkedList.nm +13 -4
  53. package/core/System/List.nm +76 -17
  54. package/core/System/Map.nm +179 -21
  55. package/core/System/Mutex.nm +4 -4
  56. package/core/System/Random.nm +6 -7
  57. package/core/System/Set.nm +99 -23
  58. package/core/System/StableList.nm +371 -0
  59. package/core/System/Stream/Directory.nm +2 -2
  60. package/core/System/Stream/File.nm +18 -18
  61. package/core/System/Stream/Http.nm +5 -5
  62. package/core/System/Stream/Tcp.nm +5 -5
  63. package/core/System/String.nm +10 -5
  64. package/core/System/StringBuilder.nm +223 -12
  65. package/core/System/Task.nm +56 -64
  66. package/core/System/Test.nm +18 -18
  67. package/core/System/Text/CharIndex.nm +9 -9
  68. package/core/System/Text/Chars.nm +1 -1
  69. package/core/System/Text/Json.nm +72 -58
  70. package/core/System/Text/JsonTree.nm +126 -98
  71. package/core/System/Text/Regex.nm +43 -38
  72. package/core/System/Text/Utf8.nm +5 -5
  73. package/core/System/Thread.nm +26 -3
  74. package/core/System/Tree.nm +19 -3
  75. package/core/System/float.nm +36 -22
  76. package/core/System/int.nm +80 -28
  77. package/core/System/int16.nm +11 -0
  78. package/core/System/int32.nm +11 -0
  79. package/core/System/int64.nm +11 -0
  80. package/core/System/int8.nm +11 -0
  81. package/core/System/uint.nm +11 -0
  82. package/core/System/uint16.nm +11 -0
  83. package/core/System/uint32.nm +11 -0
  84. package/core/System/uint64.nm +11 -0
  85. package/core/System/uint8.nm +11 -0
  86. package/core/docs/System/StringBuilder.md +6 -0
  87. package/core/docs/System/Text/JsonTree.md +3 -2
  88. package/dist/index.mjs +37622 -30603
  89. package/package.json +1 -1
  90. package/src/bench_loop.nm +9 -9
@@ -420,7 +420,7 @@ pub mv struct Container: Control {
420
420
  var int last_w = -1
421
421
  var int last_h = -1
422
422
 
423
- func init_buffers = (ref self, int cap) {
423
+ func init_buffers = (ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, int cap) {
424
424
  self.kinds.grow_int(cap)
425
425
  self.w_kinds.grow_int(cap)
426
426
  self.w_vals.grow_int(cap)
@@ -450,7 +450,7 @@ pub mv struct Container: Control {
450
450
  self.dirty_idx.grow_int(cap)
451
451
  }
452
452
 
453
- func make_root = (ref self, int kind, int gap, int col_count) {
453
+ func make_root = (ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, int kind, int gap, int col_count) {
454
454
  self.init_buffers(32)
455
455
  self.kinds.store_int(0, kind)
456
456
  self.w_kinds.store_int(0, LEN_AUTO)
@@ -507,7 +507,7 @@ pub mv struct Container: Control {
507
507
  // (The aarch64 backend now spills args past the 8-register ABI limit, so
508
508
  // this signature no longer has to stay within 8 register params.)
509
509
  func append_node = (
510
- ref self,
510
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
511
511
  int parent,
512
512
  int kind,
513
513
  int handle,
@@ -574,7 +574,7 @@ pub mv struct Container: Control {
574
574
  // shrink, the original behavior). For `.percent` / `.fill` / mixed sizing,
575
575
  // use `add_len`.
576
576
  pub func add = (
577
- ref self,
577
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
578
578
  uint64 handle,
579
579
  int w,
580
580
  int h,
@@ -600,7 +600,7 @@ pub mv struct Container: Control {
600
600
  // Add a leaf child under an explicit `parent` (a node index returned by an
601
601
  // add_vstack/add_hstack/add_grid/add_zstack call).
602
602
  pub func add_to = (
603
- ref self,
603
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
604
604
  int parent,
605
605
  uint64 handle,
606
606
  int w,
@@ -634,7 +634,7 @@ pub mv struct Container: Control {
634
634
  // asks for 50% of the cross axis and a fixed 30px on the main axis.
635
635
  // `span`/`grow`/`align`/`shrink` match `add`.
636
636
  pub func add_kind = (
637
- ref self,
637
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
638
638
  uint64 handle,
639
639
  int w_kind,
640
640
  int w_val,
@@ -662,7 +662,7 @@ pub mv struct Container: Control {
662
662
  // Add a leaf child with explicit per-axis size kinds under an explicit
663
663
  // `parent` (a node index returned by an add_* container helper).
664
664
  pub func add_to_kind = (
665
- ref self,
665
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
666
666
  int parent,
667
667
  uint64 handle,
668
668
  int w_kind,
@@ -694,7 +694,7 @@ pub mv struct Container: Control {
694
694
  // to the internal (kind, value) pair. `span`/`grow`/`align`/`shrink`
695
695
  // match `add`.
696
696
  pub func add_len = (
697
- ref self,
697
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
698
698
  uint64 handle,
699
699
  LayoutLength w,
700
700
  LayoutLength h,
@@ -720,7 +720,7 @@ pub mv struct Container: Control {
720
720
  // Add a leaf child with `LayoutLength` sizes under an explicit `parent`
721
721
  // (a node index returned by an add_* container helper).
722
722
  pub func add_to_len = (
723
- ref self,
723
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
724
724
  int parent,
725
725
  uint64 handle,
726
726
  LayoutLength w,
@@ -750,7 +750,7 @@ pub mv struct Container: Control {
750
750
  // per-axis intrinsic (e.g. fill the cross axis, intrinsic height) use
751
751
  // `add_kind` directly. `span`/`grow`/`align`/`shrink` match `add`.
752
752
  pub func add_intrinsic = (
753
- ref self,
753
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
754
754
  uint64 handle,
755
755
  int span,
756
756
  int grow = 0,
@@ -774,7 +774,7 @@ pub mv struct Container: Control {
774
774
  // `add_intrinsic` under an explicit `parent` (a node index returned by an
775
775
  // add_* container helper).
776
776
  pub func add_to_intrinsic = (
777
- ref self,
777
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
778
778
  int parent,
779
779
  uint64 handle,
780
780
  int span,
@@ -805,7 +805,7 @@ pub mv struct Container: Control {
805
805
  // re-framed. The whole tree is marked dirty afterwards so the next
806
806
  // layout reflows the rows the removed child leaves behind. Returns true
807
807
  // if a matching leaf was found and removed.
808
- pub func remove_leaf = (ref self, uint64 handle, out bool) {
808
+ pub func remove_leaf = (ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, uint64 handle, out bool) {
809
809
  var int needle = handle as int
810
810
  var removed = false
811
811
  var idx = 1
@@ -877,7 +877,7 @@ pub mv struct Container: Control {
877
877
  // Translate the legacy int (w, h) into a (kind, value) pair: 0 → auto
878
878
  // (no intrinsic; fills a bounded axis, stays 0 on an unbounded axis so
879
879
  // `grow` decides), non-zero → fixed.
880
- func set_leaf_size = (ref self, int idx, int w, int h) {
880
+ func set_leaf_size = (ref self { h_kinds, h_vals, w_kinds, w_vals }, int idx, int w, int h) {
881
881
  if w == 0 {
882
882
  self.w_kinds.store_int(idx, LEN_AUTO)
883
883
  self.w_vals.store_int(idx, 0)
@@ -895,7 +895,7 @@ pub mv struct Container: Control {
895
895
  }
896
896
 
897
897
  // Store the per-axis (kind, value) pair directly.
898
- func set_leaf_kind = (ref self, int idx, int w_kind, int w_val, int h_kind, int h_val) {
898
+ func set_leaf_kind = (ref self { h_kinds, h_vals, w_kinds, w_vals }, int idx, int w_kind, int w_val, int h_kind, int h_val) {
899
899
  self.w_kinds.store_int(idx, w_kind)
900
900
  self.w_vals.store_int(idx, w_val)
901
901
  self.h_kinds.store_int(idx, h_kind)
@@ -905,7 +905,7 @@ pub mv struct Container: Control {
905
905
  // Add a nested container under `parent`; returns the new node's index so
906
906
  // children can be added to it via add_to (or another nested container).
907
907
  pub func add_vstack = (
908
- ref self,
908
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
909
909
  int parent,
910
910
  int spacing,
911
911
  int span,
@@ -918,7 +918,7 @@ pub mv struct Container: Control {
918
918
  }
919
919
 
920
920
  pub func add_hstack = (
921
- ref self,
921
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
922
922
  int parent,
923
923
  int spacing,
924
924
  int span,
@@ -937,12 +937,12 @@ pub mv struct Container: Control {
937
937
  // to 0 on an unbounded axis (so it has no intrinsic opinion) and fills the
938
938
  // cross axis by default. Because it carries no handle, `apply` never calls
939
939
  // `setFrame:` for it and `hit_test` reports it as "no control" (handle 0).
940
- pub func add_spacer = (ref self, int span, int grow = 0, int shrink = 0, int align = 3) {
940
+ pub func add_spacer = (ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, int span, int grow = 0, int shrink = 0, int align = 3) {
941
941
  self.append_node(self.root, KIND_LEAF, 0, 0, 0, span, grow, shrink, align)
942
942
  }
943
943
 
944
944
  pub func add_spacer_to = (
945
- ref self,
945
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
946
946
  int parent,
947
947
  int span,
948
948
  int grow = 0,
@@ -953,7 +953,7 @@ pub mv struct Container: Control {
953
953
  }
954
954
 
955
955
  pub func add_grid = (
956
- ref self,
956
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
957
957
  int parent,
958
958
  int cols: cols > 0,
959
959
  int spacing,
@@ -967,7 +967,7 @@ pub mv struct Container: Control {
967
967
  }
968
968
 
969
969
  pub func add_zstack = (
970
- ref self,
970
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
971
971
  int parent,
972
972
  int span,
973
973
  int grow = 0,
@@ -986,7 +986,7 @@ pub mv struct Container: Control {
986
986
  // is a node in the SoA tree, so it needs no trait model — it recurses
987
987
  // through `first_child`/`next_sibling` like everything else.
988
988
  pub func add_block = (
989
- ref self,
989
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
990
990
  int padding,
991
991
  int span,
992
992
  int grow = 0,
@@ -1000,7 +1000,7 @@ pub mv struct Container: Control {
1000
1000
  }
1001
1001
 
1002
1002
  pub func add_block_to = (
1003
- ref self,
1003
+ ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
1004
1004
  int parent,
1005
1005
  int padding,
1006
1006
  int span,
@@ -1466,7 +1466,7 @@ pub mv struct Container: Control {
1466
1466
  // order) and its baseline is advanced. Hidden leaves keep a stable
1467
1467
  // (0,0,0,0) frame, so toggling visibility and re-laying-out marks them
1468
1468
  // dirty exactly once, like any other frame change.
1469
- func collect_dirty = (ref self) {
1469
+ func collect_dirty = (ref self { dirty_idx, prh, prw, prx, pry }) {
1470
1470
  self.dirty_n = 0
1471
1471
  var i = 0
1472
1472
  while i < self.count; i += 1 {
@@ -1513,7 +1513,7 @@ pub mv struct Container: Control {
1513
1513
  // down from this node) are all re-measured on the next `compute`/`layout`.
1514
1514
  // A node left clean is known to have unchanged constraints, so its cached
1515
1515
  // size is reused.
1516
- pub func mark_dirty = (ref self, int idx) {
1516
+ pub func mark_dirty = (ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, int idx) {
1517
1517
  self.dirty.store_int(idx, 1)
1518
1518
  var int ci = self.first_child(idx)
1519
1519
  while ci != -1 {
@@ -1598,7 +1598,7 @@ pub mv struct Container: Control {
1598
1598
  return s
1599
1599
  }
1600
1600
 
1601
- pub func set_frame = (ref self, int x, int y, int width, int height) {
1601
+ pub func set_frame = (ref self {}, int x, int y, int width, int height) {
1602
1602
  self.arrange_node(self.root, x, y, width, height)
1603
1603
  }
1604
1604
 
@@ -1616,7 +1616,7 @@ pub mv struct Container: Control {
1616
1616
  // children with `grow > 0` have surplus to absorb; the cross axis stays at
1617
1617
  // the measured content size, preserving child alignment. Grid/ZStack roots
1618
1618
  // keep both axes at content.
1619
- pub func compute = (ref self, int avail_w, int avail_h) {
1619
+ pub func compute = (ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, int avail_w, int avail_h) {
1620
1620
  // External constraint changed → the whole tree must re-measure.
1621
1621
  if self.last_w != avail_w || self.last_h != avail_h {
1622
1622
  self.mark_dirty(self.root)
@@ -1641,7 +1641,7 @@ pub mv struct Container: Control {
1641
1641
  // Measure + arrange against the window's content rect (minus padding) and
1642
1642
  // apply frames to every leaf, flipping y against the content height. The
1643
1643
  // root fills its main axis (see `compute`).
1644
- pub func layout = (ref self, Window win) {
1644
+ pub func layout = (ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, Window win) {
1645
1645
  var int cw = win.content_width()
1646
1646
  var int ch = win.content_height()
1647
1647
  var int avail_w = cw - self.padding * 2
@@ -1678,7 +1678,7 @@ pub mv struct Container: Control {
1678
1678
  // The callback calls nomen_layout_thunk (a free function) rather than the
1679
1679
  // layout method directly: free functions are exported for C linkage on
1680
1680
  // both backends, methods are not.
1681
- pub func set_resize_callback = (ref self, Window win) {
1681
+ pub func set_resize_callback = (ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, Window win) {
1682
1682
  ```
1683
1683
  #arch: c
1684
1684
  #platform: macos
@@ -1870,7 +1870,7 @@ pub mv struct Container: Control {
1870
1870
  // Window_relayout must also emit the registry + thunk they call —
1871
1871
  // putting them in Scrollable.nm broke aarch64 split links (undefined
1872
1872
  // symbols).
1873
- pub func set_document = (ref self, uint64 sv, uint64 doc) {
1873
+ pub func set_document = (ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, uint64 sv, uint64 doc) {
1874
1874
  ```
1875
1875
  #arch: c
1876
1876
  #platform: macos
@@ -1968,7 +1968,7 @@ pub mv struct Container: Control {
1968
1968
  // outlive the run — app fields. Call once, from App.start. The file-scope
1969
1969
  // registry lives HERE (same file as the layout thunk the walker calls),
1970
1970
  // for the same split-link reason set_document records.
1971
- pub func set_pane = (ref self, uint64 pane_handle) {
1971
+ pub func set_pane = (ref self { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, uint64 pane_handle) {
1972
1972
  ```
1973
1973
  #arch: c
1974
1974
  #platform: macos
@@ -2369,7 +2369,7 @@ pub mv struct Container: Control {
2369
2369
  /**
2370
2370
  * Entry point the layout engine calls to lay out a Container's tree
2371
2371
  **/
2372
- pub func nomen_layout_thunk = (ref Container grid, Window win) {
2372
+ pub func nomen_layout_thunk = (ref Container grid { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, Window win) {
2373
2373
  grid.layout(win)
2374
2374
  }
2375
2375
 
@@ -2377,7 +2377,7 @@ pub func nomen_layout_thunk = (ref Container grid, Window win) {
2377
2377
  // function (pure Nomen — asm-emitted on aarch64) so the thunk's raw bodies
2378
2378
  // can call it: constraints are the window's content width minus the grid's
2379
2379
  // own padding (the `layout_page` formula), height unbounded.
2380
- pub func nomen_scroll_measure = (ref Container grid, int max_w, out [int, int]) {
2380
+ pub func nomen_scroll_measure = (ref Container grid {}, int max_w, out [int, int]) {
2381
2381
  var bc = BoxConstraints()
2382
2382
  bc.max_width = max_w
2383
2383
  const Size cs = grid.measure(bc)
@@ -2394,7 +2394,13 @@ pub func nomen_scroll_measure = (ref Container grid, int max_w, out [int, int])
2394
2394
  // aarch64_use_c function routes to the C companion using only its raw
2395
2395
  // blocks, so any Nomen statement here would be silently dropped
2396
2396
  // (FOLLOWUP.md) — the measure goes through nomen_scroll_measure instead.
2397
- pub func nomen_scroll_thunk = (ref Container grid, uint64 sv, uint64 doc, ref Window win, int first) {
2397
+ pub func nomen_scroll_thunk = (
2398
+ ref Container grid { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals },
2399
+ uint64 sv,
2400
+ uint64 doc,
2401
+ ref Window win {},
2402
+ int first
2403
+ ) {
2398
2404
  ```
2399
2405
  #arch: c
2400
2406
  #platform: macos
@@ -87,7 +87,7 @@ pub mv struct DatePicker: Control {
87
87
  ```
88
88
  }
89
89
 
90
- pub func set_frame = (ref self, int x, int y, int width, int height) {
90
+ pub func set_frame = (ref self {}, int x, int y, int width, int height) {
91
91
  ```
92
92
  #arch: c
93
93
  #platform: macos
@@ -32,7 +32,7 @@ pub mv struct Form {
32
32
  // Wire the assembly into the caller's grid under `parent`: the box
33
33
  // fills the rect, the rows sit on top of it inset by the padding (which
34
34
  // also clears the box's built-in title strip).
35
- pub func add_to = (ref self, ref Container grid, int parent, int span) {
35
+ pub func add_to = (ref self {}, ref Container grid { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, int parent, int span) {
36
36
  var int zs = grid.add_zstack(parent, span)
37
37
  grid.add_to(zs, self.box.handle, 0, 0, 1, 1)
38
38
  var int blk = grid.add_block_to(zs, 24, 1)
@@ -41,7 +41,7 @@ pub mv struct Form {
41
41
 
42
42
  // Append a row: `label` on the left (intrinsic width), the caller's
43
43
  // control filling the rest at `control_h` tall. Up to 4 rows.
44
- pub func add_row = (ref self, ref Container grid, string label, uint64 control, int control_h) {
44
+ pub func add_row = (ref self {}, ref Container grid { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, string label, uint64 control, int control_h) {
45
45
  var uint64 label_handle = 0
46
46
  if self.rows == 0 {
47
47
  self.l0.set_text(label)
@@ -9,7 +9,7 @@
9
9
  * NSBox in its primary style with a title. macOS-only — iOS has no boxed
10
10
  * group view (TODO stubs; see GUI_PLAN Tier 1 #17).
11
11
  **/
12
- pub mv struct GroupBox : Control {
12
+ pub mv struct GroupBox: Control {
13
13
  var uint64 handle = 0
14
14
 
15
15
  pub func #init = (self, Window window, string title) {
@@ -65,7 +65,7 @@ pub mv struct GroupBox : Control {
65
65
  ```
66
66
  }
67
67
 
68
- pub func set_frame = (ref self, int x, int y, int width, int height) {
68
+ pub func set_frame = (ref self {}, int x, int y, int width, int height) {
69
69
  ```
70
70
  #arch: c
71
71
  #platform: macos
@@ -10,7 +10,7 @@
10
10
  * symbol/SF Symbol set. A failed load leaves the view empty (`has_image`
11
11
  * reads false) — there is no error channel for images.
12
12
  **/
13
- pub mv struct ImageView : Control {
13
+ pub mv struct ImageView: Control {
14
14
  var uint64 handle = 0
15
15
 
16
16
  pub func #init = (self, Window window) {
@@ -72,7 +72,7 @@ pub mv struct ImageView : Control {
72
72
  ```
73
73
  }
74
74
 
75
- pub func set_frame = (ref self, int x, int y, int width, int height) {
75
+ pub func set_frame = (ref self {}, int x, int y, int width, int height) {
76
76
  ```
77
77
  #arch: c
78
78
  #platform: macos
@@ -19,7 +19,7 @@ pub mv struct Layout {
19
19
  /**
20
20
  * Initializes a Layout tree with capacity for `cap` nodes
21
21
  **/
22
- pub func init_layout = (ref Layout l, int cap) {
22
+ pub func init_layout = (ref Layout l { gaps, hs, kinds, par, rh, rw, rx, ry, ws }, int cap) {
23
23
  l.kinds.grow_int(cap)
24
24
  l.ws.grow_int(cap)
25
25
  l.hs.grow_int(cap)
@@ -34,7 +34,7 @@ pub func init_layout = (ref Layout l, int cap) {
34
34
  /**
35
35
  * Appends a leaf node (a sized control) under `parent` and returns its index
36
36
  **/
37
- pub func add_leaf = (ref Layout l, int parent, int w, int h, out int) {
37
+ pub func add_leaf = (ref Layout l { gaps, hs, kinds, par, ws }, int parent, int w, int h, out int) {
38
38
  var idx = 0
39
39
  while l.par.load_int(idx) != 0 || idx == 0; idx += 1 {
40
40
  if l.kinds.load_int(idx) == 0 && l.ws.load_int(idx) == 0 && l.hs.load_int(idx) == 0 && l.par.load_int(idx) == 0 {
@@ -52,7 +52,7 @@ pub func add_leaf = (ref Layout l, int parent, int w, int h, out int) {
52
52
  /**
53
53
  * Appends a vertical stack container under `parent` and returns its index
54
54
  **/
55
- pub func add_vstack = (ref Layout l, int parent, int spacing, out int) {
55
+ pub func add_vstack = (ref Layout l { gaps, hs, kinds, par, ws }, int parent, int spacing, out int) {
56
56
  var idx = 0
57
57
  while true; idx += 1 {
58
58
  if l.kinds.load_int(idx) == 0 && l.ws.load_int(idx) == 0 && l.hs.load_int(idx) == 0 && l.par.load_int(idx) == 0 {
@@ -70,7 +70,7 @@ pub func add_vstack = (ref Layout l, int parent, int spacing, out int) {
70
70
  /**
71
71
  * Appends a horizontal stack container under `parent` and returns its index
72
72
  **/
73
- pub func add_hstack = (ref Layout l, int parent, int spacing, out int) {
73
+ pub func add_hstack = (ref Layout l { gaps, hs, kinds, par, ws }, int parent, int spacing, out int) {
74
74
  var idx = 0
75
75
  while true; idx += 1 {
76
76
  if l.kinds.load_int(idx) == 0 && l.ws.load_int(idx) == 0 && l.hs.load_int(idx) == 0 && l.par.load_int(idx) == 0 {
@@ -214,7 +214,7 @@ pub func arrange = (Layout l, int count, int idx, int x, int y, int w, int h) {
214
214
  /**
215
215
  * Runs a full measure-then-arrange pass from `root` within the available space
216
216
  **/
217
- pub func run_layout = (ref Layout l, int count, int root, int avail_w, int avail_h) {
217
+ pub func run_layout = (ref Layout l {}, int count, int root, int avail_w, int avail_h) {
218
218
  var int root_w = measure_w(l, count, root, 0, avail_w, 0, avail_h)
219
219
  var int root_h = l.rh.load_int(root)
220
220
  arrange(l, count, root, 0, 0, root_w, root_h)
@@ -10,7 +10,7 @@
10
10
  * Tier 1 #16 — the iOS blocks are TODO stubs). Styles: 0 relevancy,
11
11
  * 1 discrete capacity, 2 continuous capacity, 3 rating (stars).
12
12
  **/
13
- pub mv struct LevelIndicator : Control {
13
+ pub mv struct LevelIndicator: Control {
14
14
  var uint64 handle = 0
15
15
 
16
16
  pub func #init = (self, Window window) {
@@ -64,7 +64,7 @@ pub mv struct LevelIndicator : Control {
64
64
  ```
65
65
  }
66
66
 
67
- pub func set_frame = (ref self, int x, int y, int width, int height) {
67
+ pub func set_frame = (ref self {}, int x, int y, int width, int height) {
68
68
  ```
69
69
  #arch: c
70
70
  #platform: macos
@@ -22,7 +22,7 @@
22
22
  * any document view. iOS defers to UITableView (TODO stubs; see GUI_PLAN
23
23
  * Tier 2).
24
24
  **/
25
- pub mv struct ListView : Control {
25
+ pub mv struct ListView: Control {
26
26
  var uint64 handle = 0
27
27
  var uint64 table = 0
28
28
 
@@ -544,7 +544,7 @@ pub mv struct ListView : Control {
544
544
  }
545
545
 
546
546
  // ── Control trait conformance ──
547
- pub func set_frame = (ref self, int x, int y, int width, int height) {
547
+ pub func set_frame = (ref self {}, int x, int y, int width, int height) {
548
548
  ```
549
549
  #arch: c
550
550
  #platform: macos
@@ -17,7 +17,7 @@
17
17
  * Interaction needs a scene-attached view — see GUI_PLAN Tier 2; the iOS
18
18
  * blocks are TODO stubs).
19
19
  **/
20
- pub mv struct Menu : Control {
20
+ pub mv struct Menu: Control {
21
21
  var uint64 handle = 0
22
22
 
23
23
  // File-scope helper: the shared item target. The action records the
@@ -383,7 +383,7 @@ pub mv struct Menu : Control {
383
383
  // ── Control trait conformance ──
384
384
  // A menu is not laid out: it has no frame of its own (it presents at the
385
385
  // cursor under the attached control's right-click).
386
- pub func set_frame = (ref self, int x, int y, int width, int height) {
386
+ pub func set_frame = (ref self {}, int x, int y, int width, int height) {
387
387
  // No-op: the menu presents at the cursor.
388
388
  }
389
389
 
@@ -24,7 +24,7 @@ pub mv struct NumberInput {
24
24
  }
25
25
 
26
26
  // The stepper's range and nudge size.
27
- pub func set_range = (ref self, float min, float max, float increment) {
27
+ pub func set_range = (ref self {}, float min, float max, float increment) {
28
28
  self.step.set_min(min)
29
29
  self.step.set_max(max)
30
30
  self.step.set_increment(increment)
@@ -32,7 +32,7 @@ pub mv struct NumberInput {
32
32
 
33
33
  // Drive BOTH controls: the stepper holds the value, the text mirrors it
34
34
  // (the float's %f rendering).
35
- pub func set_value = (ref self, float v) {
35
+ pub func set_value = (ref self {}, float v) {
36
36
  self.step.set_value(v)
37
37
  var text = v.to_string()
38
38
  self.box.set_text(text)
@@ -48,7 +48,7 @@ pub mv struct NumberInput {
48
48
  // the box filling the row and the stepper at its intrinsic width.
49
49
  // Hit-testing works through the usual grid.contains on the fields'
50
50
  // handles.
51
- pub func add_to = (ref self, ref Container grid, int parent, int span) {
51
+ pub func add_to = (ref self {}, ref Container grid { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, int parent, int span) {
52
52
  var int hs = grid.add_hstack(parent, 6, span)
53
53
  grid.add_to(hs, self.box.handle, 0, 24, 1, 1)
54
54
  grid.add_to_intrinsic(hs, self.step.handle, 1)
@@ -24,7 +24,7 @@ pub mv struct OtpInput {
24
24
 
25
25
  // Wire the five fields into the caller's grid under `parent`: an hstack
26
26
  // of fixed-width boxes.
27
- pub func add_to = (ref self, ref Container grid, int parent, int span) {
27
+ pub func add_to = (ref self {}, ref Container grid { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, int parent, int span) {
28
28
  var int hs = grid.add_hstack(parent, 8, span)
29
29
  grid.add_to(hs, self.f0.handle, 36, 28, 0, 1)
30
30
  grid.add_to(hs, self.f1.handle, 36, 28, 0, 1)
@@ -40,7 +40,7 @@ pub mv struct OtpInput {
40
40
  }
41
41
 
42
42
  // Empty every field.
43
- pub func clear = (ref self) {
43
+ pub func clear = (ref self {}) {
44
44
  self.f0.set_text("")
45
45
  self.f1.set_text("")
46
46
  self.f2.set_text("")
@@ -18,7 +18,7 @@
18
18
  * lesson). macOS-only (no iOS counterpart; see GUI_PLAN Tier 2 — the iOS
19
19
  * blocks are TODO stubs).
20
20
  **/
21
- pub mv struct OutlineView : Control {
21
+ pub mv struct OutlineView: Control {
22
22
  var uint64 handle = 0
23
23
  var uint64 tree = 0
24
24
 
@@ -501,7 +501,7 @@ pub mv struct OutlineView : Control {
501
501
  }
502
502
 
503
503
  // ── Control trait conformance ──
504
- pub func set_frame = (ref self, int x, int y, int width, int height) {
504
+ pub func set_frame = (ref self {}, int x, int y, int width, int height) {
505
505
  ```
506
506
  #arch: c
507
507
  #platform: macos
@@ -28,7 +28,7 @@ pub mv struct Pagination {
28
28
  // The up-call plumbing: the dispatch id the app enrolled (—1 = none)
29
29
  // and whether a page change is waiting for the next tick.
30
30
  var int page_change_id = -1
31
- var bool page_change_pending = false
31
+ var page_change_pending = false
32
32
 
33
33
  pub func #init = (self, Window window, int pages: pages > 0 && pages <= 5) {
34
34
  self.prev = Button(window, "<")
@@ -56,17 +56,17 @@ pub mv struct Pagination {
56
56
  // spares can never be clicked). The closures hoist to hidden methods
57
57
  // on Pagination and run with `ref self` — the app's dispatch
58
58
  // forwards into the field that hosts the row. No polls to starve.
59
- self.prev.on_click(func () { self.prev() })
60
- self.next.on_click(func () { self.next() })
61
- self.b0.on_click(func () { self.select(0) })
62
- self.b1.on_click(func () { self.select(1) })
63
- self.b2.on_click(func () { self.select(2) })
64
- self.b3.on_click(func () { self.select(3) })
65
- self.b4.on_click(func () { self.select(4) })
59
+ self.prev.on_click(func() { self.prev() })
60
+ self.next.on_click(func() { self.next() })
61
+ self.b0.on_click(func() { self.select(0) })
62
+ self.b1.on_click(func() { self.select(1) })
63
+ self.b2.on_click(func() { self.select(2) })
64
+ self.b3.on_click(func() { self.select(3) })
65
+ self.b4.on_click(func() { self.select(4) })
66
66
  }
67
67
 
68
68
  // Wire the row into the caller's grid under `parent`.
69
- pub func add_to = (ref self, ref Container grid, int parent, int span) {
69
+ pub func add_to = (ref self {}, ref Container grid { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }, int parent, int span) {
70
70
  var int hs = grid.add_hstack(parent, 6, span)
71
71
  grid.add_to_intrinsic(hs, self.prev.handle, 1)
72
72
  grid.add_to_intrinsic(hs, self.b0.handle, 1)
@@ -100,7 +100,7 @@ pub mv struct Pagination {
100
100
  return self.current
101
101
  }
102
102
 
103
- pub func select = (ref self, int index) {
103
+ pub func select = (ref self {}, int index) {
104
104
  var int i = index
105
105
  if i < 0 { i = 0 }
106
106
  if i > self.pages - 1 { i = self.pages - 1 }
@@ -108,14 +108,14 @@ pub mv struct Pagination {
108
108
  self.page_change_pending = true
109
109
  }
110
110
 
111
- pub func next = (ref self) {
111
+ pub func next = (ref self {}) {
112
112
  if self.current < self.pages - 1 {
113
113
  self.current += 1
114
114
  self.page_change_pending = true
115
115
  }
116
116
  }
117
117
 
118
- pub func prev = (ref self) {
118
+ pub func prev = (ref self {}) {
119
119
  if self.current > 0 {
120
120
  self.current -= 1
121
121
  self.page_change_pending = true
@@ -124,7 +124,7 @@ pub mv struct Pagination {
124
124
 
125
125
  // The declared event API (docs/HANDLERS.md Stage 3): the desugar's
126
126
  // enrollment rewrite calls this with the app handler's dispatch id.
127
- pub func on_page_change = (ref self, int id) {
127
+ pub func on_page_change = (ref self {}, int id) {
128
128
  self.page_change_id = id
129
129
  }
130
130
 
@@ -133,7 +133,7 @@ pub mv struct Pagination {
133
133
  // change calls back into the app's `run_handler` (one vtable hop into
134
134
  // the concrete override). The borrow flows down per call; nothing is
135
135
  // stored and nothing outlives the tick.
136
- pub func tick = (ref self, ref App owner, ref Window win) {
136
+ pub func tick = (ref self {}, ref App owner, ref Window win {}) {
137
137
  if self.page_change_pending && self.page_change_id >= 0 {
138
138
  owner.run_handler(self.page_change_id, ref win)
139
139
  }
@@ -22,7 +22,7 @@ pub struct PopSize {
22
22
  pub var height = 0
23
23
  }
24
24
 
25
- pub mv struct Popover : Control {
25
+ pub mv struct Popover: Control {
26
26
  var uint64 handle = 0
27
27
 
28
28
  pub func #init = (self, Window window) {
@@ -249,7 +249,7 @@ pub mv struct Popover : Control {
249
249
 
250
250
  // ── Control trait conformance ──
251
251
  // A popover is window-coordinated: the layout engine never frames it.
252
- pub func set_frame = (ref self, int x, int y, int width, int height) {
252
+ pub func set_frame = (ref self {}, int x, int y, int width, int height) {
253
253
  // No-op: the popover positions itself relative to its anchor.
254
254
  }
255
255
 
@@ -10,7 +10,7 @@
10
10
  * For the spinning variant (macOS styles the SAME control differently, iOS
11
11
  * uses a distinct class) see `Spinner`.
12
12
  **/
13
- pub mv struct Progress : Control {
13
+ pub mv struct Progress: Control {
14
14
  var uint64 handle = 0
15
15
 
16
16
  pub func #init = (self, Window window) {
@@ -92,7 +92,7 @@ pub mv struct Progress : Control {
92
92
  ```
93
93
  }
94
94
 
95
- pub func set_frame = (ref self, int x, int y, int width, int height) {
95
+ pub func set_frame = (ref self {}, int x, int y, int width, int height) {
96
96
  ```
97
97
  #arch: c
98
98
  #platform: macos
@@ -12,13 +12,13 @@
12
12
  * the rest. The control itself is a CheckBox sibling (button type 4,
13
13
  * NSRadioButton). iOS defers to Segmented or a checkmark list.
14
14
  **/
15
- pub mv struct Radio : Control {
15
+ pub mv struct Radio: Control {
16
16
  var uint64 handle = 0
17
17
 
18
18
  // The `#handle` hook synthesizes `NameHandle` — a copyable, non-owning
19
19
  // twin (same public bare-self methods, no destroy) so closures can
20
20
  // capture this control without moving it. See GUI.md, "Handles".
21
- #handle = () {}
21
+ #handle = () { }
22
22
 
23
23
  pub func #init = (self, Window window, string title) {
24
24
  ```
@@ -81,7 +81,7 @@ pub mv struct Radio : Control {
81
81
  ```
82
82
  }
83
83
 
84
- pub func set_frame = (ref self, int x, int y, int width, int height) {
84
+ pub func set_frame = (ref self {}, int x, int y, int width, int height) {
85
85
  ```
86
86
  #arch: c
87
87
  #platform: macos