diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-08-19 07:12:24 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-08-19 07:12:24 -0700 |
commit | fc44a670c11fb653b3600327082eeb8df8b82563 (patch) | |
tree | 97a04b679704c75bbabb1b37cdd52258cd732b6c /eval.c | |
parent | c38f93bc7f763ae776c7e68de120faea169d7f05 (diff) | |
download | txr-fc44a670c11fb653b3600327082eeb8df8b82563.tar.gz txr-fc44a670c11fb653b3600327082eeb8df8b82563.tar.bz2 txr-fc44a670c11fb653b3600327082eeb8df8b82563.zip |
new functions: find-symbol and find-symbol-fb.
Turns out, there is already a find_symbol in lib.c, completely
unused.
* eval.c (eval_init): Register find-symbol and find-symbol-fb
intrinsics.
* lib.c (find_symbol): Fix this hitherto unused function to do
correct defaulting of the package argument and, to accept an
additional argument specifying the not-found value.
(find_symbol_fb): New function.
* lib.c (find_symbol): Declaration updated.
(find_symbol_fb): Declared.
* txr.1: Documented.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -6627,6 +6627,8 @@ void eval_init(void) reg_fun(intern(lit("unuse-package"), user_package), func_n2o(unuse_package, 1)); reg_fun(intern(lit("intern"), user_package), func_n2o(intern, 1)); reg_fun(intern(lit("unintern"), user_package), func_n2o(unintern, 1)); + reg_fun(intern(lit("find-symbol"), user_package), func_n3o(find_symbol, 1)); + reg_fun(intern(lit("find-symbol-fb"), user_package), func_n3o(find_symbol_fb, 1)); reg_fun(intern(lit("rehome-sym"), user_package), func_n2o(rehome_sym, 1)); reg_fun(intern(lit("package-fallback-list"), user_package), func_n1(package_fallback_list)); reg_fun(intern(lit("set-package-fallback-list"), user_package), func_n2(set_package_fallback_list)); |