From b63ca926df347798ea113d7b197192bd28399f5a Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Thu, 20 Jan 2022 22:53:30 +0000 Subject: =?UTF-8?q?Implement=20guards,=20and=20start=20work=20on=20?= =?UTF-8?q?=E2=86=91=20and=20=E2=86=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- array.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'array.c') 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 -- cgit v1.2.3