Symbol.st
changeset 23918 95c4a9d8b151
parent 23849 931471bc4a08
child 23920 2e34d7defd40
--- a/Symbol.st	Fri Mar 15 13:27:25 2019 +0100
+++ b/Symbol.st	Fri Mar 15 13:40:56 2019 +0100
@@ -208,14 +208,14 @@
 
 precedence
     "the precedence in an expression; 0 is highest;
-	unary < binary < keyword"
+        unary < binary < keyword"
 
-    self size = 0
-	ifTrue: [^ 0].
+    self size == 0
+        ifTrue: [^ 0].
     self first isLetter
-	ifFalse: [^ 2].
+        ifFalse: [^ 2].
     self last = $:
-	ifTrue: [^ 3].
+        ifTrue: [^ 3].
     ^ 1
 
     "
@@ -225,6 +225,7 @@
     "
 
     "Created: / 12-09-2011 / 14:53:54 / cg"
+    "Modified: / 15-03-2019 / 13:35:53 / Stefan Vogel"
 ! !
 
 !Symbol methodsFor:'Compatibility-VW'!
@@ -602,6 +603,14 @@
 
 asSymbolIfInternedOrSelf
     ^ self
+!
+
+beImmutable
+    "I am already immutable"
+
+    ^ self
+
+    "Created: / 15-03-2019 / 12:46:53 / Stefan Vogel"
 ! !
 
 !Symbol methodsFor:'copying'!
@@ -613,24 +622,6 @@
      ^ self
 !
 
-copyReplaceAll:oldElement with:newElement
-    "return a copy of the receiver as a string, where all elements equal to oldElement
-     have been replaced by newElement."
-
-"/    'Warning: #copyReplaceAll:with: will change semantics as defined in ANSI soon' errorPrintCR.
-    ^ self asString replaceAll:oldElement with:newElement
-
-    "Created: / 18.7.1998 / 23:03:38 / cg"
-!
-
-copyReplacing:oldElement withObject:newElement
-    "return a copy of the receiver, where all elements equal to oldElement
-     have been replaced by newElement.
-     ANSI version of what used to be #copyReplaceAll:with:"
-
-    ^ self asString replaceAll:oldElement with:newElement
-!
-
 deepCopy
     "return a copy of myself
      - reimplemented here since symbols are immutable."
@@ -668,9 +659,15 @@
     "this is sent by collection enumeration methods,
      if a symbol is given instead of a block as loop-block argument"
 
-    ^ anObject perform: self.
+    ^ anObject perform:self.
+
+    "
+      #negated value:#(1 2 3 4 5 6 7)
+      #(1 2 3 4 5 6 7) collect:#negated
+    "
 
     "Created: / 07-03-2019 / 17:11:23 / Stefan Vogel"
+    "Modified (format): / 15-03-2019 / 13:39:32 / Stefan Vogel"
 !
 
 value: el value:arg
@@ -831,13 +828,15 @@
      This can be a very dangerous operation - be warned.
 
      Notice: because of the danger here, this method may report an error
-	     in future versions"
+             in future versions"
 
     (Smalltalk includesKey:self) ifTrue:[
-	self primitiveFailed
+        self noModificationError.
     ] ifFalse:[
-	super becomeNil
+        super becomeNil
     ]
+
+    "Modified: / 15-03-2019 / 13:30:41 / Stefan Vogel"
 !
 
 grow:newSize