summaryrefslogtreecommitdiff
path: root/MLKCons.m
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2009-01-13 19:25:00 +0100
committerMatthias Andreas Benkard <matthias@benkard.de>2009-01-13 19:25:00 +0100
commitdf867c1495f92c0df046199557cab647a2f48170 (patch)
tree927d26f6b34784aa4a84d4b86233e77a8d439918 /MLKCons.m
parentc456224caf73a20c9421f6250f0f876196c3d8d0 (diff)
MLKDictionary: Implement required methods.
Diffstat (limited to 'MLKCons.m')
-rw-r--r--MLKCons.m10
1 files changed, 8 insertions, 2 deletions
diff --git a/MLKCons.m b/MLKCons.m
index 2ab5a8b..07c8739 100644
--- a/MLKCons.m
+++ b/MLKCons.m
@@ -177,12 +177,18 @@
-(BOOL) isEqual:(id)object
{
if ([object isKindOfClass:[MLKCons class]])
- return ([((MLKCons*)object)->_car isEqual:_car]
- && [((MLKCons*)object)->_cdr isEqual:_cdr]);
+ return ([nullify(((MLKCons*)object)->_car) isEqual:_car]
+ && [nullify(((MLKCons*)object)->_cdr) isEqual:_cdr]);
else
return NO;
}
+-(unsigned int) hash
+{
+ // FIXME: Well...
+ return [nullify(_car) hash]/2 + [nullify(_cdr) hash]/2;
+}
+
-(id) copyWithZone:(NSZone *)zone
{
MLKCons *copy = [MLKCons allocWithZone:zone];