diff options
| author | 2025-02-26 12:16:34 +0330 | |
|---|---|---|
| committer | 2025-02-26 12:16:34 +0330 | |
| commit | 93d17188c89a9197a2cb0bdad4d5ca9ac3be4461 (patch) | |
| tree | bdbd50206f87ea00a124c94b29398f9037f3014a /main.c | |
| parent | Added foreach (diff) | |
a few fixes and changes
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -1,16 +1,18 @@ // This is the test unit, not the actual code. +#define __MOONSHINE_LIBC_WARNINGS #include "moonshine.h" -int main() { - array(int) test = new (int); +void cleanup_free(var* input) { print("Free that thang ", input); } + +#define auto_free __attribute__((cleanup(cleanup_free))) - int j = 1; - for(int i = 100; i >= 0; i--) push(test, i % (j++)); +#define create(name, ...) \ + auto_free var cat(name, _parent) = __VA_ARGS__; \ + auto name = cat(name, _parent); - foreach(numba in test) { - print("Item: ", numba, " index ", numba_index); - } +int main() { + print("Wow ", strdup("Gay smex")[ 0 ]); return 0; } |
