summaryrefslogtreecommitdiff
path: root/MLKSymbol.h
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-06-17 21:20:42 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-06-17 21:20:42 +0200
commit164e403a974165af103fa072d0f14e2e256153be (patch)
tree17aa5feae4fef9eebeed7e30efd5a9e20b1d1c5d /MLKSymbol.h
parentb11b87db720955acae99a558ef18dd5b6995022d (diff)
MLKDynamicContext#+initialize: Fix various sources of crashes.
Diffstat (limited to 'MLKSymbol.h')
-rw-r--r--MLKSymbol.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/MLKSymbol.h b/MLKSymbol.h
index 82526d2..3aa2a1e 100644
--- a/MLKSymbol.h
+++ b/MLKSymbol.h
@@ -18,13 +18,16 @@
#import "MLKLispValue.h"
+#import <Foundation/NSObject.h>
+
@class MLKPackage;
-@interface MLKSymbol : MLKLispValue
+@interface MLKSymbol : MLKLispValue <NSCopying>
{
NSString *name;
MLKPackage *homePackage;
+ MLKSymbol *real_identity;
}
-(MLKSymbol *) initWithName:(id)aName package:(id)aPackage;
@@ -35,5 +38,20 @@
-(NSString *)descriptionForLisp;
+// PLEASE DO NOT USE THIS.
+//
+// Symbols should never be copied. MLKSymbol needs to implement
+// NSCopying as well as suitable version of isEqual: so that symbols can
+// be used as dictionary keys. Don't call -copy on a symbol manually,
+// please.
+-(id) copyWithZone:(NSZone *)zone;
+
+// PLEASE DO NOT USE THIS.
+//
+// It uses an ugly hack for determining symbol identity in the face of
+// copying. (The hack is called real_identity and it's an ivar of this
+// class.) See the comment above copyWithZone: for why it even exists.
+-(BOOL) isEqual:(id)object;
+
-(void) dealloc;
@end