summaryrefslogtreecommitdiff
path: root/MLKCons.m
diff options
context:
space:
mode:
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];