2692 |
(string->symbol "K. Harper, M.D."))) @result{} #t |
(string->symbol "K. Harper, M.D."))) @result{} #t |
2693 |
@end lisp |
@end lisp |
2694 |
|
|
2695 |
|
From C, there are lower level functions that construct a Scheme symbol |
2696 |
|
from a null terminated C string or from a sequence of bytes whose length |
2697 |
|
is specified explicitly. |
2698 |
|
|
2699 |
|
@deffn {C Function} scm_str2symbol (const char * name) |
2700 |
|
@deffnx {C Function} scm_mem2symbol (const char * name, size_t len) |
2701 |
|
Construct and return a Scheme symbol whose name is specified by |
2702 |
|
@var{name}. For @code{scm_str2symbol} @var{name} must be null |
2703 |
|
terminated; For @code{scm_mem2symbol} the length of @var{name} is |
2704 |
|
specified explicitly by @var{len}. |
2705 |
|
@end deffn |
2706 |
|
|
2707 |
Finally, some applications, especially those that generate new Scheme |
Finally, some applications, especially those that generate new Scheme |
2708 |
code dynamically, need to generate symbols for use in the generated |
code dynamically, need to generate symbols for use in the generated |
2709 |
code. The @code{gensym} primitive meets this need: |
code. The @code{gensym} primitive meets this need: |