// a datatype you made, or a map with keys of a datatype you made, you need to provide an overload
// to core.hash.to_u32 for your datatype. In this program, that definition is at the end of the file.
person_set := set.make(Person);
- person_set << Person.{ "Joe", 38 };
- person_set << Person.{ "Jane", 36 };
- person_set << Person.{ "Joe", 38 };
+ person_set << .{ "Joe", 38 };
+ person_set << .{ "Jane", 36 };
+ person_set << .{ "Joe", 38 };
// "Joe" will only be printed once.
for person: set.iterator(^person_set) {
}
// NOTE: Try operator overloading before checking everything else.
- if ((binop->left->type != NULL && binop->right->type != NULL) &&
- (binop->left->type->kind != Type_Kind_Basic || binop->right->type->kind != Type_Kind_Basic)) {
+ if ((binop->left->type != NULL && binop->left->type->kind != Type_Kind_Basic)
+ || (binop->right->type != NULL && binop->right->type->kind != Type_Kind_Basic)) {
AstCall *implicit_call = binaryop_try_operator_overload(binop);
if (implicit_call == (AstCall *) &node_that_signals_a_yield)
default: assert(("Bad macro body type.", 0));
}
+
+ return NULL;
}
b32 entity_bring_to_state(Entity* ent, EntityState state) {