diff options
author | Peter Mikkelsen <petermikkelsen10@gmail.com> | 2022-01-20 22:53:30 +0000 |
---|---|---|
committer | Peter Mikkelsen <petermikkelsen10@gmail.com> | 2022-01-20 22:53:30 +0000 |
commit | b63ca926df347798ea113d7b197192bd28399f5a (patch) | |
tree | 18f4161678fe0d7239e4ebb735ab76cdb24745dd /array.c | |
parent | 35f20421e7a4942b61c4a1910e8da0bf35f21fd9 (diff) |
Implement guards, and start work on ↑ and ↓
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -264,4 +264,19 @@ comparearray(Array *a, Array *b, int checkshapes) return -1; else return 0; +} + +Array * +fillelement(Array *a) +{ + switch(a->type){ + case AtypeInt: return mkscalarint(0); + case AtypeFloat: return mkscalarfloat(0); + case AtypeRune: return mkscalarrune(' '); + case AtypeArray: + default: + print("Can't make fill element of array type %d\n", a->type); + exits(nil); + return 0; + } }
\ No newline at end of file |