projects
/
onyx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
677ab65
)
using shorter for syntax in a test case
author
Brendan Hansen
<brendan.f.hansen@gmail.com>
Mon, 29 Nov 2021 20:15:41 +0000
(14:15 -0600)
committer
Brendan Hansen
<brendan.f.hansen@gmail.com>
Mon, 29 Nov 2021 20:15:41 +0000
(14:15 -0600)
tests/baked_parameters.onyx
patch
|
blob
|
history
diff --git
a/tests/baked_parameters.onyx
b/tests/baked_parameters.onyx
index 237afbc3890ec14495b4a103f95f6a541541f98b..77bd3a63bff7e8ef5bc96e3b8240e933a1f3ce1d 100644
(file)
--- a/
tests/baked_parameters.onyx
+++ b/
tests/baked_parameters.onyx
@@
-9,7
+9,7
@@
count_to :: ($N: i32) {
alloc_slice :: ($T: type_expr, N: i32) -> [] T {
data := cast(^T) calloc(sizeof T * N);
- return
<[] T>
.{ data, N };
+ return .{ data, N };
}
count_to_30 :: #solidify count_to { N = #value 30 };
@@
-25,9
+25,9
@@
main :: (args: [] cstr) {
count_to(UP_TO);
sl := alloc_slice(i32, 10);
- for ^
elem: sl do *elem
= 1234;
+ for ^
sl do *it
= 1234;
- for
elem: sl do println(elem
);
+ for
sl do println(it
);
// This is so much cleaner than the alternative.