From dc84927c791873508f473f1d5679550882f86e91 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 16 Nov 2016 06:41:55 -0800 Subject: Completion of fallback list implementation. * lib.c (find_symbol): New function. (symbol_present): Search the fallback list also to determine whether the symbol is visible. * lib.h (find_symbol): Declared. * parser.y (sym_helper): Implement a new behavior for qualified symbols. Interning new symbols is only allowed for packages that have an empty fallback list. * parser.c (get_visible_syms): New static function. (find_matching_syms): Use get_visible_syms to get the list of eligible symbols. This way the fallback list of the package is included if it is the current package. * share/txr/stdlib/package.tl (defpackage): Do not insert a default (:use usr) if there is no :usr clause. Since defpackage is very new, no need for backward compatibility; the amount of code depending on this is likely zero. * txr.1: Documented fallback list feature. --- lib.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib.h') diff --git a/lib.h b/lib.h index e17f0668..7f99632b 100644 --- a/lib.h +++ b/lib.h @@ -789,6 +789,7 @@ val use_sym(val use_list, val package); val unuse_sym(val symbol, val package); val use_package(val use_list, val package); val unuse_package(val unuse_list, val package); +val find_symbol(val str, val package); val intern(val str, val package); val unintern(val sym, val package); val rehome_sym(val sym, val package); -- cgit v1.2.3