Exemple #1
0
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;
}
Exemple #2
0
Fichier : PHash.c Projet : ADTSH/io
PHash *PHash_clone(PHash *self)
{
	PHash *other = PHash_new();
	PHash_copy_(other, self);
	return other;
}
Exemple #3
0
PHash *PHash_clone(PHash *self)
{
	PHash *child = PHash_new();
	PHash_copy_(child, self);
	return child;
}