comparing
authorStefan Vogel <sv@exept.de>
Mon, 23 Jun 2008 18:01:47 +0200
changeset 3641 b2a5cd89c3c5
parent 3640 1ea7118dff13
child 3642 c50ea6035370
comparing
TranslatedSymbol.st
--- a/TranslatedSymbol.st	Mon Jun 23 16:29:14 2008 +0200
+++ b/TranslatedSymbol.st	Mon Jun 23 18:01:47 2008 +0200
@@ -126,6 +126,32 @@
     string := stringArg.
 ! !
 
+!TranslatedSymbol methodsFor:'comparing'!
+
+= aSymbolOrTranslatedSymbol
+    "two TranslatedSymbols are equal, if they have the same symbol"
+
+    aSymbolOrTranslatedSymbol isString ifTrue:[
+        ^ symbol = aSymbolOrTranslatedSymbol.
+    ].
+    self species == aSymbolOrTranslatedSymbol species ifTrue:[
+        ^ symbol = aSymbolOrTranslatedSymbol symbol
+    ].
+    ^ false
+
+    "
+        (TranslatedSymbol symbol:#hash string:'x') = #hash
+        (TranslatedSymbol symbol:#hash string:'x') = 1
+        (TranslatedSymbol symbol:#hash string:'x') = (TranslatedSymbol symbol:#hash string:'y')
+    "
+!
+
+hash
+    "two TranslatedSymbols are equal, if they have the same symbol"
+
+    ^ symbol hash
+! !
+
 !TranslatedSymbol methodsFor:'converting'!
 
 asString
@@ -178,5 +204,5 @@
 !TranslatedSymbol class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/TranslatedSymbol.st,v 1.2 2008-06-23 14:26:57 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/TranslatedSymbol.st,v 1.3 2008-06-23 16:01:47 stefan Exp $'
 ! !