string->symbol - string to symbol conversion
(import (rnrs)) ;R6RS
(import (rnrs base)) ;R6RS
(import (scheme r5rs)) ;R7RS
(import (scheme base)) ;R7RS
Returns the symbol whose name is
This procedure can create symbols that cannot be read back with
after being written with
In R6RS implementations this happens when
is the empty string, because there is no lexical syntax for the symbol
with the empty name. (In R7RS the empty symbol is written as
Returns a single value; a symbol.
In the examples below the behavior would change if a case-folding
reader was used. This may be enabled with the #!fold-case
directive. In R6RS this directive appears in the non-normative
appendix. In R5RS and earlier reports it was possible for case
conversion, either to upper or lower case, to be enabled by default.
(eq? 'mISSISSIppi 'mississippi)
=> the symbol with name "mISSISSIppi"
(eq? 'bitBlt (string->symbol "bitBlt"))
(string=? "K. Harper, M.D."
(string->symbol "K. Harper, M.D.")))
This procedure is in all Scheme reports starting with R2RS.
This procedure can raise exceptions with the following condition types:
- &assertion (R6RS)
The wrong number of arguments was passed or an argument was outside its domain.
The assertions described above are errors.
Implementations may signal an error, extend the procedure's
domain of definition to include such arguments,
or fail catastrophically.
This procedure first appeared with this name in R2RS. Earlier Scheme
running on MacLisp had the
procedure that returned an atomic symbol's print name as a character
This page is part of the
It includes materials from the RnRS documents.
More information can be found at
There are implementations that do not garbage collect the symbol
Markup created by unroff 1.0sc, March 04, 2023.