IoObject *IoObject_localsProto(void *state) { IoObject *self = IoObject_new(state); IoObject_createSlotsIfNeeded(self); PHash_copy_(IoObject_slots(self), IoObject_slots(IoObject_firstProto(self))); IoObject_rawRemoveAllProtos(self); // Locals handles := and = IoObject_addMethod_(self, IOSYMBOL("setSlot"), IoObject_protoSet_to_); IoObject_addMethod_(self, IOSYMBOL("setSlotWithType"), IoObject_protoSetSlotWithType); IoObject_addMethod_(self, IOSYMBOL("updateSlot"), IoObject_localsUpdateSlot); IoObject_addMethod_(self, IOSYMBOL("thisLocalContext"), IoObject_locals); // Everything else is forwarded to self IoObject_addMethod_(self, IOSYMBOL("forward"), IoObject_localsForward); return self; }
PHash *PHash_clone(PHash *self) { PHash *other = PHash_new(); PHash_copy_(other, self); return other; }
PHash *PHash_clone(PHash *self) { PHash *child = PHash_new(); PHash_copy_(child, self); return child; }