Squeak Class Documentation category index | class index  
 
Symbol
  category: Collections-Text
  superclass: String
  subclasses:

I represent Strings that are created uniquely. Thus, someString asSymbol == someString asSymbol.

instance methods
  Camp Smalltalk
  sunitAsClass

  accessing
  at:put:
precedence
replaceFrom:to:with:startingAt:

  comparing
  =
hashMappedBy:

  converting
  asString
asSymbol
capitalized

  copying
  clone
copy
shallowCopy
veryDeepCopyWith:

  filter streaming
  byteEncode:

  printing
  isOrientedFill
storeOn:

  private
  errorNoModification
species
string:
stringhash

  system primitives
  flushCache

  testing
  isInfix
isKeyword
isLiteral
isPvtSelector
isUnary

  user interface
  asExplorerString

class methods
  access
  selectorsContaining:
thatStarts:skipping:

  class initialization
  allSymbolTablesDo:
allSymbolTablesDo:after:
compactSymbolTable
compareTiming
initialize

  instance creation
  intern:
internCharacter:
lookup:
newFrom:
readFrom:

  new symbol table
 

  private
  hasInterned:ifTrue:
possibleSelectorsFor:
rehash
shutDown:

instance methods
  Camp Smalltalk top  
 

sunitAsClass


  accessing top  
 

at:put:

You cannot modify the receiver.


 

precedence

Answer the receiver's precedence, assuming it is a valid Smalltalk
message selector or 0 otherwise. The numbers are 1 for unary,
2 for binary and 3 for keyword selectors.


 

replaceFrom:to:with:startingAt:

Primitive. This destructively replaces elements from start to stop in the receiver starting at index, repStart, in the collection, replacement. Answer the receiver. Range checks are performed in the primitive only. Optional. See Object documentation whatIsAPrimitive.


  comparing top  
 

=

Use == between two symbols...


 

hashMappedBy:

Answer what my hash would be if oops changed according to map.


  converting top  
 

asString

Refer to the comment in String|asString.


 

asSymbol

Refer to the comment in String|asSymbol.


 

capitalized

Return a copy with the first letter capitalized


  copying top  
 

clone

Answer with the receiver, because Symbols are unique.


 

copy

Answer with the receiver, because Symbols are unique.


 

shallowCopy

Answer with the receiver, because Symbols are unique.


 

veryDeepCopyWith:

Return self. I am immutable in the Morphic world. Do not record me.


  filter streaming top  
 

byteEncode:


  printing top  
 

isOrientedFill

Needs to be implemented here because symbols can occupy 'color' slots of morphs.


 

storeOn:

Print inside string quotes, doubling inbedded quotes.


  private top  
 

errorNoModification


 

species

Answer the preferred class for reconstructing the receiver. For example,
collections create new collections whenever enumeration messages such as
collect: or select: are invoked. The new kind of collection is determined by
the species of the original collection. Species and class are not always the
same. For example, the species of Interval is Array.


 

string:


 

stringhash


  system primitives top  
 

flushCache

Tell the interpreter to remove all entries with this symbol as a selector from its method lookup cache, if it has one. This primitive must be called whenever a method is defined or removed.
NOTE: Only one of the two selective flush methods needs to be used.
Squeak 2.3 and later uses 116 (See CompiledMethod flushCache).


  testing top  
 

isInfix

Answer whether the receiver is an infix message selector.


 

isKeyword

Answer whether the receiver is a message keyword.


 

isLiteral

Answer whether the receiver is a valid Smalltalk literal.


 

isPvtSelector

Answer whether the receiver is a private message selector, that is,
begins with 'pvt' followed by an uppercase letter, e.g. pvtStringhash.


 

isUnary

Answer whether the receiver is an unary message selector.


  user interface top  
 

asExplorerString


class methods
  access top  
 

selectorsContaining:

Answer a list of selectors that contain aString within them. Case-insensitive. Does return symbols that begin with a capital letter.


 

thatStarts:skipping:

Answer a selector symbol that starts with leadingCharacters.
Symbols beginning with a lower-case letter handled directly here.
Ignore case after first char.
If skipSym is not nil, it is a previous answer; start searching after it.
If no symbols are found, answer nil.
Used by Alt-q (Command-q) routines


  class initialization top  
 

allSymbolTablesDo:


 

allSymbolTablesDo:after:


 

compactSymbolTable

Reduce the size of the symbol table so that it holds all existing symbols + 25% (changed from 1000 since sets like to have 25% free and the extra space would grow back in a hurry)


 

compareTiming


Symbol compareTiming


 

initialize

Symbol initialize


  instance creation top  
 

intern:


 

internCharacter:


 

lookup:


 

newFrom:

Answer an instance of me containing the same elements as aCollection.


 

readFrom:

Symbol readFromString: '#abc'


  new symbol table top  

  private top  
 

hasInterned:ifTrue:

Answer with false if aString hasnt been interned (into a Symbol),
otherwise supply the symbol to symBlock and return true.


 

possibleSelectorsFor:

Answer an ordered collection of possible corrections
for the misspelled selector in order of likelyhood


 

rehash

Symbol rehash


 

shutDown:

This message is sent on system shutdown to registered classes