summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-03-21 22:40:06 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-03-21 22:40:06 -0700
commitef81bb38d3261c07dc8fa4fb8eb50bcfcfc04667 (patch)
tree65af8330c7f39621d7f230e4916de789b9411f0d
parent7995694f138ccef0113ac0494790eb0461f5d44e (diff)
downloadtxr-ef81bb38d3261c07dc8fa4fb8eb50bcfcfc04667.tar.gz
txr-ef81bb38d3261c07dc8fa4fb8eb50bcfcfc04667.tar.bz2
txr-ef81bb38d3261c07dc8fa4fb8eb50bcfcfc04667.zip
lib: switch from use function to ignore function
* stdlib/compiler.tl (compiler (comp-atom, comp-dwim), safe-const-reduce, igno-notfound): Use ignore rather than use for marking unused variable. * stdlib/copy-file.tl (copy-files, copy-path-rec, remove-path-rec, chmod-rec, chown-rec): Likewise. * stdlib/optimize.tl (basic-block print): Likewise.
-rw-r--r--stdlib/compiler.tl9
-rw-r--r--stdlib/copy-file.tl28
-rw-r--r--stdlib/optimize.tl2
3 files changed, 19 insertions, 20 deletions
diff --git a/stdlib/compiler.tl b/stdlib/compiler.tl
index 0b271cfd..b0f2d0f4 100644
--- a/stdlib/compiler.tl
+++ b/stdlib/compiler.tl
@@ -569,7 +569,7 @@
(t (compile-error form "invalid operator")))))))
(defmeth compiler comp-atom (me oreg form)
- (use oreg)
+ (ignore oreg)
(cond
((null form) (new (frag '(t 0) nil)))
(t (let ((dreg me.(get-dreg form)))
@@ -1662,8 +1662,7 @@
(defmeth compiler comp-dwim (me oreg env form)
(mac-param-bind form (t obj . args) form
- (use obj)
- (use args)
+ (ignore obj args)
(let* ((l1-exprs (cdr form))
(fun (car l1-exprs))
(bind env.(lookup-lisp1 fun nil)))
@@ -2224,7 +2223,7 @@
^(quote ,result)
result))
(t (exc)
- (use exc)
+ (ignore exc)
(set throws t)
form)))
(ece (new eval-cache-entry
@@ -2327,7 +2326,7 @@
use-sym unuse-sym))
(defmacro ign-notfound (form)
- ^(usr:catch ,form (path-not-found (. rest) (use rest) nil)))
+ ^(usr:catch ,form (path-not-found (. rest) (ignore rest))))
(defun open-compile-streams (in-path out-path test-fn)
(if (and (nullify in-path)
diff --git a/stdlib/copy-file.tl b/stdlib/copy-file.tl
index 1c01f5b5..7f7559d5 100644
--- a/stdlib/copy-file.tl
+++ b/stdlib/copy-file.tl
@@ -85,10 +85,10 @@
(return (copy-file path (path-cat dest-dir (base-name path))
preserve-perms preserve-times))
(skip `skip copying @path` (exc . args)
- (use args) (use exc)
+ (ignore args exc)
(return))
(retry `retry copying @path` (exc . args)
- (use args) (use exc))))))
+ (ignore args exc))))))
(defun cat-files (to-path . from-paths)
(let ((buf (make-buf copy-size)))
@@ -146,7 +146,7 @@
(unwind-protect
(ftw from-dir
(lambda (path type stat . rest)
- (use rest)
+ (ignore rest)
(while t
(catch**
(let* ((rel-path (rel-path from-dir path))
@@ -172,10 +172,10 @@
(do-copy-obj path tgt-path stat opts)))
(return))
(skip `skip copying @path` (exc . args)
- (use exc) (use args)
+ (ignore exc args)
(return))
(retry `retry copying @path` (exc . args)
- (use exc) (use args)))))
+ (ignore exc args)))))
ftw-phys)
(whilet ((top (pop dir-stack)))
(do-tweak-obj top.path top.stat opts nil)))))
@@ -183,7 +183,7 @@
(defun remove-path-rec (path)
(ftw path
(lambda (path type . rest)
- (use rest)
+ (ignore rest)
(while t
(catch**
(return
@@ -193,16 +193,16 @@
(ftw-dp (rmdir path))
(t (remove-path path))))
(skip `skip removing @path` (exc . args)
- (use exc) (use args)
+ (ignore exc args)
(return))
(retry `retry copying @path` (exc . args)
- (use exc) (use args)))))
+ (ignore exc args)))))
(logior ftw-phys ftw-depth)))
(defun chmod-rec (path perm)
(ftw path
(lambda (path type . rest)
- (use rest)
+ (ignore rest)
(while t
(catch**
(return
@@ -212,16 +212,16 @@
(ftw-sl)
(t (chmod path perm))))
(skip `skip chmod @path` (exc . args)
- (use exc) (use args)
+ (ignore exc args)
(return))
(retry `retry chmod @path` (exc . args)
- (use exc) (use args)))))
+ (ignore exc args)))))
(logior ftw-phys)))
(defun chown-rec (path uid gid)
(ftw path
(lambda (path type . rest)
- (use rest)
+ (ignore rest)
(while t
(catch**
(return
@@ -230,10 +230,10 @@
'remove-rec path))
(t (lchown path uid gid))))
(skip `skip chown @path` (exc . args)
- (use exc) (use args)
+ (ignore exc args)
(return))
(retry `retry chown @path` (exc . args)
- (use exc) (use args)))))
+ (ignore exc args)))))
(logior ftw-phys)))
(defun touch (path : ref-path)
diff --git a/stdlib/optimize.tl b/stdlib/optimize.tl
index 387fea1a..99b59210 100644
--- a/stdlib/optimize.tl
+++ b/stdlib/optimize.tl
@@ -42,7 +42,7 @@
nojoin
(:method print (bl stream pretty-p)
- (use pretty-p)
+ (ignore pretty-p)
(put-string "#S" stream)
(print ^(basic-block live ,bl.live
label ,bl.label