Symbol.st
changeset 24026 1d8362c3d5ea
parent 23920 2e34d7defd40
child 24121 d0148c842873
equal deleted inserted replaced
24025:6337612d7653 24026:1d8362c3d5ea
   202 
   202 
   203 ! !
   203 ! !
   204 
   204 
   205 
   205 
   206 
   206 
       
   207 
   207 !Symbol methodsFor:'Compatibility-Squeak'!
   208 !Symbol methodsFor:'Compatibility-Squeak'!
   208 
   209 
   209 precedence
   210 precedence
   210     "the precedence in an expression; 0 is highest;
   211     "the precedence in an expression; 0 is highest;
   211         unary < binary < keyword"
   212         unary < binary < keyword"
   737 
   738 
   738 "/ ST-80 behavior:
   739 "/ ST-80 behavior:
   739 "/  ^ self storeString
   740 "/  ^ self storeString
   740 
   741 
   741     ^ self asString
   742     ^ self asString
   742 !
       
   743 
       
   744 storeArrayElementOn:aStream
       
   745     "store myself on a stream.
       
   746      I am stored as an array element, so the '#' may be omitted sometimes.
       
   747      Take care for special symbols"
       
   748 
       
   749     |storeString|
       
   750 
       
   751     storeString := self storeString.
       
   752     (self == #true or:[self == #false or:[self == #nil or:[(storeString at:2) == $']]]) ifTrue:[
       
   753 	aStream nextPutAll:storeString.
       
   754     ] ifFalse:[
       
   755 	aStream nextPutAll:self.
       
   756     ].
       
   757 !
   743 !
   758 
   744 
   759 storeOn:aStream
   745 storeOn:aStream
   760     "store myself on a stream"
   746     "store myself on a stream"
   761 
   747 
   805       #'_hello' storeString
   791       #'_hello' storeString
   806       #'123'  storeString
   792       #'123'  storeString
   807     "
   793     "
   808 ! !
   794 ! !
   809 
   795 
       
   796 !Symbol methodsFor:'private array element printing'!
       
   797 
       
   798 displayArrayElementOn:aStream
       
   799     "Display myself as an Array element on a stream.
       
   800      I am displayed as an array element, so the '#' may be omitted sometimes.
       
   801      Take care for special symbols"
       
   802 
       
   803     self storeArrayElementOn:aStream.       "storeString is same as printString"
       
   804 
       
   805     "Created: / 29-03-2019 / 12:00:50 / stefan"
       
   806 !
       
   807 
       
   808 printArrayElementOn:aStream
       
   809     "Print myself as an Array element on a stream.
       
   810      I am printed as an array element, so the '#' may be omitted sometimes.
       
   811      Take care for special symbols"
       
   812 
       
   813     self storeArrayElementOn:aStream.       "storeString is same as printString"
       
   814 
       
   815     "Created: / 29-03-2019 / 11:56:25 / stefan"
       
   816 !
       
   817 
       
   818 storeArrayElementOn:aStream
       
   819     "store myself on a stream.
       
   820      I am stored as an array element, so the '#' may be omitted sometimes.
       
   821      Take care for special symbols"
       
   822 
       
   823     |storeString|
       
   824 
       
   825     storeString := self storeString.
       
   826     (self == #true or:[self == #false or:[self == #nil or:[(storeString at:2) == $']]]) ifTrue:[
       
   827 	aStream nextPutAll:storeString.
       
   828     ] ifFalse:[
       
   829 	aStream nextPutAll:self.
       
   830     ].
       
   831 ! !
       
   832 
   810 !Symbol methodsFor:'queries'!
   833 !Symbol methodsFor:'queries'!
   811 
   834 
   812 species
   835 species
   813     "when copying, or concatenating, return instances of this class"
   836     "when copying, or concatenating, return instances of this class"
   814 
   837