@@ -51,9 +51,9 @@ export fn make_intrinsic(
5151 const new = alloc(struct {
5252 eval: *fn([]MalType) (MalType | error) = func,
5353 meta: MalType = nil,
54- });
54+ })! ;
5555
56- append(gc.memory.intrinsics, new);
56+ append(gc.memory.intrinsics, new)! ;
5757 return new;
5858};
5959
@@ -66,7 +66,7 @@ export fn make_func(
6666
6767 let arg_list: []MalType = [];
6868 if(len(args) > 0) {
69- arg_list = alloc([nil...], len(args));
69+ arg_list = alloc([nil...], len(args))! ;
7070 arg_list[0..] = args;
7171 };
7272
@@ -75,9 +75,9 @@ export fn make_func(
7575 envi: *env= envi,
7676 args: []MalType = arg_list,
7777 body: MalType = body,
78- meta: MalType = nil });
78+ meta: MalType = nil })! ;
7979
80- append(gc.memory.funcs, new);
80+ append(gc.memory.funcs, new)! ;
8181 return new;
8282};
8383
@@ -91,14 +91,14 @@ export fn make_list(s: size, init: []MalType = []) list = {
9191 const new: list = alloc(struct {
9292 data: []MalType = [],
9393 meta: MalType = nil,
94- });
94+ })! ;
9595
9696 if (s == 0) return new;
9797
98- new.data = alloc([nil...], s);
98+ new.data = alloc([nil...], s)! ;
9999 new.data[0..len(init)] = init;
100100
101- append(gc.memory.lists, new);
101+ append(gc.memory.lists, new)! ;
102102 return new;
103103};
104104
@@ -112,14 +112,14 @@ export fn make_vec(s: size, init: []MalType = []) vector = {
112112 const new: vector = alloc(struct {
113113 data: []MalType = [],
114114 meta: MalType = nil,
115- });
115+ })! ;
116116
117117 if (s == 0) return new;
118118
119- new.data = alloc([nil...], s);
119+ new.data = alloc([nil...], s)! ;
120120 new.data[0..len(init)] = init;
121121
122- append(gc.memory.vecs, new);
122+ append(gc.memory.vecs, new)! ;
123123 return new;
124124};
125125
@@ -144,22 +144,22 @@ export fn make_symbol(name: str) symbol = {
144144 return s;
145145 };
146146
147- const new = strings::dup(name): symbol;
147+ const new = strings::dup(name)! : symbol;
148148 hm_add(gc.memory.symbols: hashmap, new, new);
149149
150150 return new;
151151};
152152
153153export fn make_string(s: str) string = {
154154
155- const new_str = strings::dup(s);
155+ const new_str = strings::dup(s)! ;
156156
157157 const new = alloc(struct {
158158 data: str = new_str,
159159 meta: MalType = nil,
160- });
160+ })! ;
161161
162- append(gc.memory.strings, new);
162+ append(gc.memory.strings, new)! ;
163163 return new;
164164};
165165
@@ -170,8 +170,8 @@ fn free_string(s: string) void = {
170170
171171export fn make_atom(ref: MalType) atom = {
172172
173- const new = alloc(ref);
174- append(gc.memory.atoms, new);
173+ const new = alloc(ref)! ;
174+ append(gc.memory.atoms, new)! ;
175175 return new;
176176};
177177
0 commit comments