summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'array.c')
-rw-r--r--array.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/array.c b/array.c
index 1167cea..37cd159 100644
--- a/array.c
+++ b/array.c
@@ -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