diff options
| author | 2022-08-18 09:34:17 +0200 | |
|---|---|---|
| committer | 2022-08-18 09:34:23 +0200 | |
| commit | 8c81c70b904a41b8a0d44dc418b7c39bf325c2a2 (patch) | |
| tree | 2e0eca07bf7889aea322d84e7966672aca62010f /bootstrap/test.cff | |
| parent | 1c25c197d860ad49bb6a84e077a54e5aaf441bbd (diff) | |
macro bodyarg
Diffstat (limited to 'bootstrap/test.cff')
| -rw-r--r-- | bootstrap/test.cff | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bootstrap/test.cff b/bootstrap/test.cff index d835b7e..6f5242d 100644 --- a/bootstrap/test.cff +++ b/bootstrap/test.cff @@ -10,10 +10,10 @@ enum Color { Red, Green, Blue } -defmacro each(i, x, arr, ...body) [ +defmacro each(i, x, arr, &body) [ for let i = 0; i < arr.#len; ++i { let x = arr[i]; - { body } + body } ] @@ -88,9 +88,9 @@ extern fn main (argc int, argv **u8) int { let is []int = { [4] = 1, 2, [1 - 1] = 3 }; isort(is, is.#len); - each(i, x, is, + each(i, x, is) { printf("%d\n", x); - ) + } let slice [#]int = is[3::5]; printf("sl %d\n", slice[0]); |