if cast(i32) handle == 0 do return .BadFile, 0;
bytes_written := __net_send(handle, buffer);
- if bytes_written < 0 { s.vtable = null; }
+ if bytes_written < 0 { s.vtable = null; return .EOF, 0; }
return .None, bytes_written;
},
return (package core.array).delete(x, idx);
}
-append :: macro (x: &dyn_str, other: str) {
- (package core.array).concat(x, other);
+append :: #match {
+ macro (x: &dyn_str, other: str) {
+ (package core.array).concat(x, other);
+ },
+
+ macro (x: &dyn_str, other: u8) {
+ (package core.array).push(x, other);
+ },
}
clear :: macro (x: &dyn_str) {
string.append(&output, "Hello");
string.append(&output, "World");
- string.append(&output, "!");
+ string.append(&output, '!');
string.insert(&output, 5, ", ");