CharacterArray.st
changeset 21126 df27a601562c
parent 21122 a75ae33b406f
child 21128 46bd3b6dba0f
--- a/CharacterArray.st	Sun Dec 11 19:04:24 2016 +0100
+++ b/CharacterArray.st	Mon Dec 12 16:31:37 2016 +0100
@@ -350,7 +350,6 @@
     "Created: 3.8.1997 / 18:16:40 / cg"
 ! !
 
-
 !CharacterArray class methodsFor:'cleanup'!
 
 lowSpaceCleanup
@@ -4986,8 +4985,6 @@
 ! !
 
 
-
-
 !CharacterArray methodsFor:'matching - glob expressions'!
 
 compoundMatch:aString
@@ -6593,7 +6590,7 @@
                         (argArrayOrDictionary includesKey:key) ifTrue:[
                             v := argArrayOrDictionary at:key
                         ] ifFalse:[
-                            key := key asSymbolIfInterned ? key.
+                            key := key asSymbolIfInternedOrSelf.
                             (argArrayOrDictionary includesKey:key) ifTrue:[
                                 v := argArrayOrDictionary at:key
                             ] ifFalse:[
@@ -6613,9 +6610,9 @@
                             v := argArrayOrDictionary
                                     at:next
                                     ifAbsent:[
-                                        "try symbol instead of character"
+                                        "try symbol or string instead of character"
                                         argArrayOrDictionary
-                                            at:next asSymbol
+                                            at:next asSymbolIfInternedOrSelf
                                             ifAbsent:[String with:escapeCharacter with:next].
                                  ].
                         ] ifFalse:[
@@ -8040,6 +8037,42 @@
     "
 !
 
+isInfix
+    "return true, if the receiver is a binary message selector"
+
+    ^ self first isLetterOrDigit not
+
+    "
+     #at:put: isInfix
+     #at: isInfix
+     #+ isInfix
+     #size isInfix
+    "
+
+    "Created: / 1.11.1997 / 12:34:55 / cg"
+    "Modified: / 1.11.1997 / 12:36:37 / cg"
+!
+
+isKeyword
+    "return true, if the receiver is a keyword message selector.
+     This is a quick check, which only looks at the last character.
+     Should only be used, if we already know that the receiver forms a valid selector.
+     To check an arbitrary string, use isKeywordSelector.
+     Bad naming, but compatibility is asking for it."
+
+    ^ self last == $:
+
+    "
+     #at:put: isKeyword
+     #at: isKeyword
+     #+ isKeyword
+     #size isKeyword
+    "
+
+    "Created: / 01-11-1997 / 12:34:55 / cg"
+    "Modified (comment): / 30-04-2016 / 18:19:11 / cg"
+!
+
 isKeywordSelector
     "return true, iff there are only alphanumeric or underline characters separated by colons.
      Must end with a colon.
@@ -8152,6 +8185,14 @@
     ^ true
 !
 
+isUnary
+    "Answer true if the receiver is a unary selector.
+     That is not a check for being a valid selector, but instead relies on
+     the selector being valid."
+
+    ^ self isUnarySelector
+!
+
 isUnarySelector
     "Answer true if the receiver contains only chars in an ANSI unary method selector, false otherwise."
 
@@ -8278,7 +8319,6 @@
     ^ aVisitor visitString:self with:aParameter
 ! !
 
-
 !CharacterArray class methodsFor:'documentation'!
 
 version