r7rs-small-texinfo

Unnamed repository; edit this file 'description' to name the repository.
git clone https://kaka.farm/~git/r7rs-small-texinfo
Log | Files | Refs

commit 67c68cee073c12eebe2263aa4ec557189384ab67
parent 7d7aab4312f88aab62190dd215e0cf4346df4d68
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date:   Sun,  4 Feb 2024 13:44:06 -0500

Symbols: Reflow paragraphs & tidy examples.

Diffstat:
Mdoc/r7rs-small/procedures/symbols.texinfo | 79+++++++++++++++++++++++++++++++++++++++++--------------------------------------
1 file changed, 41 insertions(+), 38 deletions(-)

diff --git a/doc/r7rs-small/procedures/symbols.texinfo b/doc/r7rs-small/procedures/symbols.texinfo @@ -1,81 +1,84 @@ @node Symbols @section Symbols -Symbols are objects whose usefulness rests on the fact that two symbols are identical (in -the sense of @code{eqv?}) if and only if their names are spelled the same way. For instance, they -can be used the way enumerated values are used in other languages. +Symbols are objects whose usefulness rests on the fact that two symbols +are identical (in the sense of @code{eqv?}) if and only if their names are +spelled the same way. For instance, they can be used the way enumerated +values are used in other languages. -The rules for writing a symbol are exactly the same as the rules for writing an identifier; -see @ref{Identifiers} and @ref{Lexical structure}. +The rules for writing a symbol are exactly the same as the rules for +writing an identifier; see @ref{Identifiers} and @ref{Lexical structure}. -It is guaranteed that any symbol that has been returned as part of a literal expression, -or read using the read procedure, and subsequently written out using the write -procedure, will read back in as the identical symbol (in the sense of @code{eqv?}). +It is guaranteed that any symbol that has been returned as part of a +literal expression, or read using the read procedure, and subsequently +written out using the write procedure, will read back in as the identical +symbol (in the sense of @code{eqv?}). -Note: Some implementations have values known as ``uninterned symbols,'' which -defeat write/read invariance, and also violate the rule that two symbols are the -same if and only if their names are spelled the same. This report does not specify -the behavior of implementation-dependent extensions. +Note: Some implementations have values known as ``uninterned symbols,'' +which defeat write/read invariance, and also violate the rule that two +symbols are the same if and only if their names are spelled the same. This +report does not specify the behavior of implementation-dependent +extensions. @deffn procedure symbol? obj Returns @code{#t} if @var{obj} is a symbol, otherwise returns @code{#f}. @lisp -(symbol? 'foo) @result{} #t -(symbol? (car '(a b))) @result{} #t -(symbol? "bar") @result{} #f -(symbol? 'nil) @result{} #t -(symbol? '()) @result{} #f -(symbol? #f) @result{} #f +(symbol? 'foo) @result{} #t +(symbol? (car '(a b))) @result{} #t +(symbol? "bar") @result{} #f +(symbol? 'nil) @result{} #t +(symbol? '()) @result{} #f +(symbol? #f) @result{} #f @end lisp @end deffn @deffn procedure symbol=? @vari{symbol} @varii{symbol} @variii{symbol}@dots{} -Returns @code{#t} if all the arguments all have the same names in the sense of @code{string=?}. +Returns @code{#t} if all the arguments all have the same names in the +sense of @code{string=?}. -Note: The definition above assumes that none of the arguments are uninterned -symbols. +Note: The definition above assumes that none of the arguments are +uninterned symbols. @end deffn @deffn procedure symbol->string symbol -Returns the name of -@var{symbol} as a string, but without adding escapes. It is an error to apply mutation -procedures like @code{string-set!} to strings returned by this procedure. +Returns the name of @var{symbol} as a string, but without adding +escapes. It is an error to apply mutation procedures like +@code{string-set!} to strings returned by this procedure. @lisp -(symbol->string 'flying-fish) - @result{} "flying-fish" -(symbol->string 'Martin) @result{} "Martin" +(symbol->string 'flying-fish) @result{} "flying-fish" +(symbol->string 'Martin) @result{} "Martin" (symbol->string - (string->symbol "Malvina")) - @result{} "Malvina" + (string->symbol "Malvina")) + @result{} "Malvina" @end lisp @end deffn @deffn procedure string->symbol string -Returns the symbol whose name is -@var{string}. This procedure can create symbols with names containing special characters that -would require escaping when written, but does not interpret escapes in its input. +Returns the symbol whose name is @var{string}. This procedure can +create symbols with names containing special characters that would +require escaping when written, but does not interpret escapes in its +input. @lisp -(string->symbol "mISSISSIppi") -@result{}mISSISSIppi -(eqv? 'bitBlt (string->symbol "bitBlt")) -@result{} #t +(string->symbol "mISSISSIppi") @result{} mISSISSIppi +(eqv? 'bitBlt + (string->symbol "bitBlt")) @result{} #t (eqv? 'LollyPop (string->symbol (symbol->string 'LollyPop))) -@result{} #t + @result{} #t (string=? "K. Harper, M.D." (symbol->string (string->symbol "K. Harper, M.D."))) -@result{} #t + @result{} #t @end lisp @end deffn