diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-06-04 08:24:32 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-06-04 08:24:32 -0700 |
commit | 35e78942bed148e1a23ffc7eaa50dc38d81f1af9 (patch) | |
tree | 275bd5b19a853f54f61c1eb2840b99308e1af2da /stdlib/compiler.tl | |
parent | f73ef8182bebb9344d445edbb2f210ada03c8469 (diff) | |
download | txr-35e78942bed148e1a23ffc7eaa50dc38d81f1af9.tar.gz txr-35e78942bed148e1a23ffc7eaa50dc38d81f1af9.tar.bz2 txr-35e78942bed148e1a23ffc7eaa50dc38d81f1af9.zip |
compiler: new function, clean-file.
This function simplifies cleaning, by allowing a file to
be cleaned to be identified in much the same way as an input
file to load or compile-file.
* autoload.c (compiler_set_entries): The clean-file symbol
is interned and becomes an autoload trigger for the
compiler module.
* stdlib/compiler.tl (clean-file): New function.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'stdlib/compiler.tl')
-rw-r--r-- | stdlib/compiler.tl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/stdlib/compiler.tl b/stdlib/compiler.tl index 62893e94..ea8124e8 100644 --- a/stdlib/compiler.tl +++ b/stdlib/compiler.tl @@ -2425,6 +2425,22 @@ (list in-stream out-stream out-path))) +(defun clean-file (path) + (let* ((parent *load-path*) + (path (if (and parent (pure-rel-path-p path)) + (path-cat (dir-name parent) path) + path))) + (match-case path + (@(or `@base.tlo` + `@base.tlo.gz`) + (ignore base) + (remove-path path)) + (@(or `@base.txr` + `@base.tl` + `@base`) + (or (remove-path `@base.tlo` nil) + (remove-path `@base.tlo.gz` nil)))))) + (defun list-from-vm-desc (vd) (list (sys:vm-desc-nlevels vd) (sys:vm-desc-nregs vd) |