Symbol.st
changeset 12473 828e275ddf8b
parent 11859 752a9509eadf
child 12765 56e48bb757ce
equal deleted inserted replaced
12472:4538fa289fda 12473:828e275ddf8b
    97 
    97 
    98 %{  /* NOCONTEXT */
    98 %{  /* NOCONTEXT */
    99     OBJ newSymbol;
    99     OBJ newSymbol;
   100 
   100 
   101     if (__isSymbol(aString)) {
   101     if (__isSymbol(aString)) {
   102 	RETURN (aString);
   102         RETURN (aString);
   103     }
   103     }
   104     if (__isString(aString)) {
   104     if (__isStringLike(aString)) {
   105 	newSymbol = __MKSYMBOL(__stringVal(aString), (OBJ *)0);
   105         newSymbol = __MKSYMBOL(__stringVal(aString), (OBJ *)0);
   106 	if (newSymbol != nil) {
   106         if (newSymbol != nil) {
   107 	    RETURN (newSymbol);
   107             RETURN (newSymbol);
   108 	}
   108         }
   109     }
   109     }
   110 %}.
   110 %}.
   111     aString class ~~ String ifTrue:[
   111     (aString class ~~ String and:[aString class ~~ ImmutableString]) ifTrue:[
   112 	"/
   112         "only allowed to intern strings"
   113 	"/ only allowed to intern strings
   113         ^ self mustBeString
   114 	"/
       
   115 	^ self mustBeString
       
   116     ].
   114     ].
   117     ^ ObjectMemory allocationFailureSignal raise.
   115     ^ ObjectMemory allocationFailureSignal raise.
   118 !
   116 !
   119 
   117 
   120 internCharacter:aCharacter
   118 internCharacter:aCharacter
   692 ! !
   690 ! !
   693 
   691 
   694 !Symbol class methodsFor:'documentation'!
   692 !Symbol class methodsFor:'documentation'!
   695 
   693 
   696 version
   694 version
   697     ^ '$Header: /cvs/stx/stx/libbasic/Symbol.st,v 1.88 2009-08-15 06:54:44 sr Exp $'
   695     ^ '$Header: /cvs/stx/stx/libbasic/Symbol.st,v 1.89 2009-11-05 16:25:14 stefan Exp $'
   698 ! !
   696 !
       
   697 
       
   698 version_CVS
       
   699     ^ '$Header: /cvs/stx/stx/libbasic/Symbol.st,v 1.89 2009-11-05 16:25:14 stefan Exp $'
       
   700 ! !