write arrays with brackets in tests

The tests spelled out (¤ ...), what [...] reads into, which nobody
writes. The reader's own tests keep it: there it is the point.
This commit is contained in:
2026-10-09 16:32:36 +03:00
parent 08853d2c77
commit 52228e6fc6
8 changed files with 55 additions and 55 deletions

View File

@@ -25,8 +25,8 @@
(fn origin-x ((p (* (struct point)))) int
(return (. (* p) x)))
(fn second-of ((xs (¤ float 4))) float
(return (¤ xs 1)))
(fn second-of ((xs [float 4])) float
(return [xs 1]))
(fn say ((fmt (* const char)) ...) void
(var ap va-list)
@@ -43,8 +43,8 @@
(var f (fn ((* (struct point))) int) origin-x)
(printf "aggregate: %d\n" (f (& p)))
(var xs (¤ float 4) #(1.5 2.5 3.5 4.5))
(var g (fn ((¤ float 4)) float) second-of)
(var xs [float 4] #(1.5 2.5 3.5 4.5))
(var g (fn ([float 4]) float) second-of)
(printf "array: %g\n" (g xs))
(say "variadic: %d %s\n" 1 "two")