diff options
Diffstat (limited to 'bootstrap/test.cff')
| -rw-r--r-- | bootstrap/test.cff | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/bootstrap/test.cff b/bootstrap/test.cff index be6cb95..95ee7bf 100644 --- a/bootstrap/test.cff +++ b/bootstrap/test.cff @@ -10,9 +10,8 @@ enum Color { Red, Green, Blue } -defmacro arraylength(ary) [ (sizeof(ary)/sizeof(ary[0])) ] defmacro each(i, x, arr, ...body) [ - for let i = 0; i < arraylength(arr); ++i { + for let i = 0; i < arr.#len; ++i { let x = arr[i]; { body } } @@ -60,7 +59,7 @@ extern fn main (argc int, argv **u8) int { printf("mag = %g\n", (&x)->mag()); let is []int = { [4] = 1, 2, [1 - 1] = 3 }; - isort(is, arraylength(is)); + isort(is, is.#len); each(i, x, is, printf("%d\n", x); ) |