diff options
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 |