diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-08-20 20:10:43 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-08-20 20:10:43 -0700 |
commit | 0689691933695945e2f8f4ddd160da958bde936f (patch) | |
tree | 726a5d0d5f4dcd8eeae6d1845bb66357866679b8 /txr.1 | |
parent | 607f0d271211e37d96ce7ba50a3f69372c000779 (diff) | |
download | txr-0689691933695945e2f8f4ddd160da958bde936f.tar.gz txr-0689691933695945e2f8f4ddd160da958bde936f.tar.bz2 txr-0689691933695945e2f8f4ddd160da958bde936f.zip |
New function: intern-fb.
To accompany find-symbol-fb, there is intern-fb, which is like
intern, but searches the fallback list.
* eval.c (eval_init): Register intern-fb intrinsic.
* lib.c (intern_fallback_intrinsic): New function. Does
defaulting and error checks, then calls intern_fallback, just
like intern_intrinsic calls intern.
* lib.h (intern_fallback_intrinsic): Declared.
* txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 26 |
1 files changed, 24 insertions, 2 deletions
@@ -50364,7 +50364,10 @@ clause of the .code defpackage macro. The fallback package list plays a role only in three situations: one in the \*(TL parser, one in the printer, and one in the interactive -listener. +listener. Besides that, two library functions refer to it: +.code intern-fb +and +.codn find-symbol-fb . The parser situation involving the fallback list occurs when the \*(TL parser resolves an unqualified symbol token: a symbol token not carrying @@ -51004,7 +51007,7 @@ package objects. Strings are taken to be package names, which must resolve to existing packages. Symbols are reduced to strings via .codn symbol-name . -.coNP Function @ intern +.coNP Functions @ intern and @ intern-fb .synb .mets (intern < name <> [ package ]) .syne @@ -51033,6 +51036,25 @@ is created and inserted into and that symbol is returned. In this case, the package becomes the symbol's home package. +The +.code intern-fb +function is very similar to +.code intern +except that if the symbol is not found in +.meta package +then the packages listed in the fallback list of +.meta package +are searched, in order. Only these packages themselves are searched, +not their own fallback lists. If a symbol called +.meta name +is found, the search terminates and that symbol is returned. +Only if nothing is found in the fallback list will +.code intern-fb +create a new symbol and insert it into +.metn package , +exactly like +.codn intern . + .coNP Function @ unintern .synb .mets (unintern < symbol <> [ package ]) |