There are no implementation-specific limits on the size or content of symbol names. It is however not allowed to write on the strings which have been passed to #'make-symbol
or returned from #'symbol-name
.
cl_object
ecl_make_keyword (char *name);
¶Find a lisp keyword
Description
Many Lisp functions take keyword arguments. When invoking a function with keyword arguments we need keywords, which are a kind of symbols that live in the keyword
package. This function does the task of finding or creating those keywords from C strings.
ecl_make_keyword("TO")
with return :TO
, while ecl_make_keyword("to")
returns a completely different keyword, :|to|
. In short, you usually want to use uppercase.
Example
The following example converts a section of a string to uppercase characters:
cl_object start = ecl_make_keyword("START"); cl_object end = ecl_make_keyword("END"); ... sup = cl_string_upcase(4, s, start, ecl_make_fixnum(2), end, ecl_make_fixnum(6));
cl_object
ecl_make_symbol (const char *name, const char *package_name);
¶Find a lisp symbol
Description
This function finds or create a symbol in the given package. First of all, it tries to find the package named by package_name. If it does not exist, an error is signaled. Then, a symbol with the supplied name is created and interned in the given package.
Common Lisp and C equivalence
Lisp symbol | C function |
---|---|
boundp | cl_object cl_boundp(cl_object symbolp) |
copy-symbol | cl_object cl_copy_symbol(cl_narg narg, cl_object symbol, ...) |
get | cl_object cl_get(cl_narg narg, cl_object sym, cl_object indicator, ...) |
gensym | cl_object cl_gensym(cl_narg narg, ...) |
gentemp | cl_object cl_gentemp(cl_narg narg, ...) |
keywordp | cl_object cl_keywordp(cl_object object) |
make-symbol | cl_object cl_make_symbol(cl_object name) |
makunbound | cl_object cl_makunbound(cl_object makunbound) |
remprop | cl_object cl_remprop(cl_object symbol, cl_object indicator) |
set | cl_object cl_set(cl_object symbol, cl_object value) |
symbolp | cl_object cl_symbolp(cl_object object) |
symbol-function | cl_object cl_symbol_function(cl_object symbol) |
(setf symbol-function) | cl_object si_fset(cl_narg narg, cl_object function_name, cl_object definition, ...) |
symbol-name | cl_object cl_symbol_name(cl_object symbol) |
symbol-package | cl_object cl_symbol_package(cl_object symbol) |
symbol-plist | cl_object cl_symbol_plist(cl_object symbol) |
(setf symbol-plist) | cl_object si_set_symbol_plist(cl_object symbol, cl_object plist) |
symbol-value | cl_object cl_symbol_value(cl_object symbol) |