1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-29 08:20:20 +02:00

Document scm_str2symbol and scm_mem2symbol.

This commit is contained in:
Neil Jerram 2003-04-26 15:30:59 +00:00
parent 63bf8015ab
commit d513f5c6b3
2 changed files with 15 additions and 0 deletions

View file

@ -1,5 +1,8 @@
2003-04-26 Neil Jerram <neil@ossau.uklinux.net>
* scheme-data.texi (Symbol Primitives): Document scm_str2symbol
and scm_mem2symbol.
* data-rep.texi (Describing a New Type): Clarify that
scm_make_smob_type_mfpe is deprecated. (Thanks to
tomas@fabula.de.)

View file

@ -2692,6 +2692,18 @@ the case-sensitivity of symbols:
(string->symbol "K. Harper, M.D."))) @result{} #t
@end lisp
From C, there are lower level functions that construct a Scheme symbol
from a null terminated C string or from a sequence of bytes whose length
is specified explicitly.
@deffn {C Function} scm_str2symbol (const char * name)
@deffnx {C Function} scm_mem2symbol (const char * name, size_t len)
Construct and return a Scheme symbol whose name is specified by
@var{name}. For @code{scm_str2symbol} @var{name} must be null
terminated; For @code{scm_mem2symbol} the length of @var{name} is
specified explicitly by @var{len}.
@end deffn
Finally, some applications, especially those that generate new Scheme
code dynamically, need to generate symbols for use in the generated
code. The @code{gensym} primitive meets this need: