[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash f3ae7bb 259/316: Alias -remove-item to remove
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dash f3ae7bb 259/316: Alias -remove-item to remove |
Date: |
Mon, 15 Feb 2021 15:58:13 -0500 (EST) |
branch: externals/dash
commit f3ae7bb6157e5c3002483fb84d2bdc4213c21b1c
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>
Alias -remove-item to remove
* dash.el (-remove-item): Define as an alias of remove for speed.
* dev/examples.el (-remove-item): Extend tests.
* README.md:
* dash.texi: Regenerate docs.
---
README.md | 15 ++++++++-------
dash.el | 10 ++++------
dash.texi | 11 ++++++-----
dev/examples.el | 7 ++++++-
4 files changed, 24 insertions(+), 19 deletions(-)
diff --git a/README.md b/README.md
index d355116..135bc88 100644
--- a/README.md
+++ b/README.md
@@ -132,7 +132,7 @@ Functions returning a sublist of the original list.
* [-remove](#-remove-pred-list) `(pred list)`
* [-remove-first](#-remove-first-pred-list) `(pred list)`
* [-remove-last](#-remove-last-pred-list) `(pred list)`
-* [-remove-item](#-remove-item-item-list) `(item list)`
+* [-remove-item](#-remove-item-arg1-arg2) `(arg1 arg2)`
* [-non-nil](#-non-nil-list) `(list)`
* [-slice](#-slice-list-from-optional-to-step) `(list from &optional to step)`
* [-take](#-take-n-list) `(n list)`
@@ -548,7 +548,7 @@ original tail. If no item is removed, then the result is a
complete copy.
Alias: `-reject-first`.
This function's anaphoric counterpart is `--remove-first`.
-See also [`-map-first`](#-map-first-pred-rep-list),
[`-remove-item`](#-remove-item-item-list), and
[`-remove-last`](#-remove-last-pred-list).
+See also [`-map-first`](#-map-first-pred-rep-list),
[`-remove-item`](#-remove-item-arg1-arg2), and
[`-remove-last`](#-remove-last-pred-list).
```el
(-remove-first #'natnump '(-2 -1 0 1 2)) ;; => '(-2 -1 1 2)
@@ -563,7 +563,7 @@ The result is a copy of `list` regardless of whether an
element is
removed.
Alias: `-reject-last`.
This function's anaphoric counterpart is `--remove-last`.
-See also [`-map-last`](#-map-last-pred-rep-list),
[`-remove-item`](#-remove-item-item-list), and
[`-remove-first`](#-remove-first-pred-list).
+See also [`-map-last`](#-map-last-pred-rep-list),
[`-remove-item`](#-remove-item-arg1-arg2), and
[`-remove-first`](#-remove-first-pred-list).
```el
(-remove-last #'natnump '(1 3 5 4 7 8 10 -11)) ;; => '(1 3 5 4 7 8 -11)
@@ -571,16 +571,17 @@ See also [`-map-last`](#-map-last-pred-rep-list),
[`-remove-item`](#-remove-item
(--remove-last (> it 3) '(1 2 3 4 5 6 7 8 9 10)) ;; => '(1 2 3 4 5 6 7 8 9)
```
-#### -remove-item `(item list)`
+#### -remove-item `(arg1 arg2)`
-Remove all occurrences of `item` from `list`.
+Return a copy of `list` with all occurrences of `item` removed.
+The comparison is done with `equal`.
-Comparison is done with `equal`.
+(fn `item` `list`)
```el
(-remove-item 3 '(1 2 3 2 3 4 5 3)) ;; => '(1 2 2 4 5)
(-remove-item 'foo '(foo bar baz foo)) ;; => '(bar baz)
-(-remove-item "bob" '("alice" "bob" "eve" "bob" "dave")) ;; => '("alice" "eve"
"dave")
+(-remove-item "bob" '("alice" "bob" "eve" "bob")) ;; => '("alice" "eve")
```
#### -non-nil `(list)`
diff --git a/dash.el b/dash.el
index d499928..449b53a 100644
--- a/dash.el
+++ b/dash.el
@@ -509,12 +509,10 @@ See also `-map-last', `-remove-item', and
`-remove-first'."
(defalias '-reject-last '-remove-last)
(defalias '--reject-last '--remove-last)
-(defun -remove-item (item list)
- "Remove all occurrences of ITEM from LIST.
-
-Comparison is done with `equal'."
- (declare (pure t) (side-effect-free t))
- (--remove (equal it item) list))
+(defalias '-remove-item #'remove
+ "Return a copy of LIST with all occurrences of ITEM removed.
+The comparison is done with `equal'.
+\n(fn ITEM LIST)")
(defmacro --keep (form list)
"Anaphoric form of `-keep'."
diff --git a/dash.texi b/dash.texi
index a37ab85..e55522b 100644
--- a/dash.texi
+++ b/dash.texi
@@ -579,10 +579,11 @@ See also @code{-map-last} (@pxref{-map-last}),
@code{-remove-item} (@pxref{-remo
@end defun
@anchor{-remove-item}
-@defun -remove-item (item list)
-Remove all occurrences of @var{item} from @var{list}.
+@defun -remove-item (arg1 arg2)
+Return a copy of @var{list} with all occurrences of @var{item} removed.
+The comparison is done with @code{equal}.
-Comparison is done with @code{equal}.
+(fn @var{item} @var{list})
@example
@group
@@ -594,8 +595,8 @@ Comparison is done with @code{equal}.
@result{} '(bar baz)
@end group
@group
-(-remove-item "bob" '("alice" "bob" "eve" "bob" "dave"))
- @result{} '("alice" "eve" "dave")
+(-remove-item "bob" '("alice" "bob" "eve" "bob"))
+ @result{} '("alice" "eve")
@end group
@end example
@end defun
diff --git a/dev/examples.el b/dev/examples.el
index 56e95da..ebe616b 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -201,7 +201,12 @@ new list."
(defexamples -remove-item
(-remove-item 3 '(1 2 3 2 3 4 5 3)) => '(1 2 2 4 5)
(-remove-item 'foo '(foo bar baz foo)) => '(bar baz)
- (-remove-item "bob" '("alice" "bob" "eve" "bob" "dave")) => '("alice"
"eve" "dave"))
+ (-remove-item "bob" '("alice" "bob" "eve" "bob")) => '("alice" "eve")
+ (-remove-item nil '()) => '()
+ (-remove-item nil '(nil)) => '()
+ (let ((l (list 1 2))) (setcar (-remove-item 0 l) 0) l) => '(1 2)
+ (let ((l (list 1 2))) (setcar (-remove-item 1 l) 0) l) => '(1 2)
+ (let ((l (list 1 2))) (setcar (-remove-item 2 l) 0) l) => '(1 2))
(defexamples -non-nil
(-non-nil '(1 nil 2 nil nil 3 4 nil 5 nil)) => '(1 2 3 4 5))
- [elpa] externals/dash 2625bc5 247/316: Don't use insert-file-contents-literally, (continued)
- [elpa] externals/dash 2625bc5 247/316: Don't use insert-file-contents-literally, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 7583e65 248/316: Revert --map to using mapcar, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 6f5888c 251/316: Extend --filter and --remove docs and tests, ELPA Syncer, 2021/02/15
- [elpa] externals/dash db45ee7 252/316: Optimize -remove-first a bit, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 0e5acda 260/316: Simplify -non-nil, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 9ad0d2b 266/316: Extend -map-indexed docs and tests, ELPA Syncer, 2021/02/15
- [elpa] externals/dash f61769d 256/316: * dash.el (dash--keywords): Prefer rx., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 2aeb4e4 264/316: Use actual advertised function signature in README, ELPA Syncer, 2021/02/15
- [elpa] externals/dash a536770 267/316: Prefer relative image links in README, ELPA Syncer, 2021/02/15
- [elpa] externals/dash ce4a344 258/316: Eliminate odd? from examples, ELPA Syncer, 2021/02/15
- [elpa] externals/dash f3ae7bb 259/316: Alias -remove-item to remove,
ELPA Syncer <=
- [elpa] externals/dash 525ede2 265/316: Improve docstring Markdown formatting, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 4a32a5d 257/316: Write -remove-last in terms of --remove-last, ELPA Syncer, 2021/02/15
- [elpa] externals/dash cbd3b29 268/316: * .elpaignore: Exclude dev/ from GNU ELPA tarball., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 2a10547 271/316: Fix handling nils of -some-->, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 0789fd0 273/316: Fix -some--> docstring and Edebug spec, ELPA Syncer, 2021/02/15
- [elpa] externals/dash e0254c5 274/316: * dash.el (-doto): Fix Edebug spec., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 46e43c0 277/316: Fix long-standing typo in Texinfo generation, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 65eeaf6 278/316: Fix long-standing typo in examples, ELPA Syncer, 2021/02/15
- [elpa] externals/dash dbbf617 281/316: Remove dead code from examples-to-info.el, ELPA Syncer, 2021/02/15
- [elpa] externals/dash ee9bceb 284/316: Leave Texinfo docstring indentation as is, ELPA Syncer, 2021/02/15