diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-12-22 07:13:33 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-12-22 07:13:33 -0800 |
commit | 638293d5281db1276a3b64f2eb969ad99c0ee9f3 (patch) | |
tree | b9d369af312ea49431b89ae2da96a5e9e9f3e82f /stdlib | |
parent | 75b1508c61d3805d1678a8dabf8d48b9e76c8d37 (diff) | |
download | txr-638293d5281db1276a3b64f2eb969ad99c0ee9f3.tar.gz txr-638293d5281db1276a3b64f2eb969ad99c0ee9f3.tar.bz2 txr-638293d5281db1276a3b64f2eb969ad99c0ee9f3.zip |
New functions: subq, subql, subqual and subst.
* eval.c (eval_init): Register new intrinsics.
* lib.c, lib.h (subq, subql, subqual, subst): New functions.
* tests/012/seq.tl: New test cases.
* stdlib/optimize.tl (subst): Function removed. The new subst
drop-in replaces this one.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/doc-syms.tl | 4 | ||||
-rw-r--r-- | stdlib/optimize.tl | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/stdlib/doc-syms.tl b/stdlib/doc-syms.tl index 78229519..6be397ea 100644 --- a/stdlib/doc-syms.tl +++ b/stdlib/doc-syms.tl @@ -1887,6 +1887,10 @@ ("sub-str" "N-03CFFEF2") ("sub-tree" "N-0398FBE2") ("sub-vec" "N-03BFFF0A") + ("subq" "N-01B32285") + ("subql" "N-01B32285") + ("subqual" "N-01B32285") + ("subst" "N-01F8EF22") ("subtypep" "N-00699D3B") ("succ" "N-038E636C") ("sum" "N-0163FFE2") diff --git a/stdlib/optimize.tl b/stdlib/optimize.tl index 11b85aca..4b7b3ec5 100644 --- a/stdlib/optimize.tl +++ b/stdlib/optimize.tl @@ -345,11 +345,6 @@ ((nequal ninsn oinsn) (append (ldiff code tail) (list ninsn))) (t code)))) -(defun subst (x y list) - (mapcar (lambda (item) - (if (equal item x) y item)) - list)) - (defun subst-preserve (x y bb li list) (let ((sub (subst x y list))) (cond |