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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user