コード例 #1
0
ファイル: IoObject.c プロジェクト: AlexGensek/io
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;
}
コード例 #2
0
ファイル: PHash.c プロジェクト: ADTSH/io
PHash *PHash_clone(PHash *self)
{
	PHash *other = PHash_new();
	PHash_copy_(other, self);
	return other;
}
コード例 #3
0
ファイル: PHash.c プロジェクト: cdcarter/io
PHash *PHash_clone(PHash *self)
{
	PHash *child = PHash_new();
	PHash_copy_(child, self);
	return child;
}