[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash b3c58ff 221/316: Fix docstring of -list
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dash b3c58ff 221/316: Fix docstring of -list |
Date: |
Mon, 15 Feb 2021 15:58:04 -0500 (EST) |
branch: externals/dash
commit b3c58ffdb1739d601bc388cc7c7a9e7bd8e753f5
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>
Fix docstring of -list
* dash.el (-list): Fix doc in the case that the first argument is
already a list.
* dev/examples.el (-list): Expand tests.
* README.md:
* dash.texi: Regenerate docs.
Fixes #225.
---
README.md | 7 +++----
dash.el | 10 ++++------
dash.texi | 7 +++----
dev/examples.el | 7 ++++++-
4 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/README.md b/README.md
index ec1b8a7..780f941 100644
--- a/README.md
+++ b/README.md
@@ -2034,10 +2034,9 @@ if the first element should sort before the second.
#### -list `(&rest args)`
-Return a list with `args`.
-
-If first item of `args` is already a list, simply return `args`. If
-not, return a list with `args` as elements.
+Return a list based on `args`.
+If the first item of `args` is already a list, simply return it.
+Otherwise, return a list with `args` as elements.
```el
(-list 1) ;; => '(1)
diff --git a/dash.el b/dash.el
index e65a8d0..2303681 100644
--- a/dash.el
+++ b/dash.el
@@ -2515,13 +2515,11 @@ if the first element should sort before the second."
`(-sort (lambda (it other) ,form) ,list))
(defun -list (&rest args)
- "Return a list with ARGS.
-
-If first item of ARGS is already a list, simply return ARGS. If
-not, return a list with ARGS as elements."
+ "Return a list based on ARGS.
+If the first item of ARGS is already a list, simply return it.
+Otherwise, return a list with ARGS as elements."
(declare (pure t) (side-effect-free t))
- (let ((arg (car args)))
- (if (listp arg) arg args)))
+ (if (listp (car args)) (car args) args))
(defun -repeat (n x)
"Return a new list of length N with each element being X.
diff --git a/dash.texi b/dash.texi
index 3aea063..bf1bd7b 100644
--- a/dash.texi
+++ b/dash.texi
@@ -3116,10 +3116,9 @@ if the first element should sort before the second.
@anchor{-list}
@defun -list (&rest args)
-Return a list with @var{args}.
-
-If first item of @var{args} is already a list, simply return @var{args}. If
-not, return a list with @var{args} as elements.
+Return a list based on @var{args}.
+If the first item of @var{args} is already a list, simply return it.
+Otherwise, return a list with @var{args} as elements.
@example
@group
diff --git a/dev/examples.el b/dev/examples.el
index a7a95ed..0715e20 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -926,7 +926,12 @@ value rather than consuming a list to produce a single
value."
(-list 1) => '(1)
(-list 1 2 3) => '(1 2 3)
(-list '(1 2 3)) => '(1 2 3)
- (-list '((1) (2))) => '((1) (2)))
+ (-list '((1) (2))) => '((1) (2))
+ (-list) => ()
+ (-list ()) => ()
+ (-list () 1) => ()
+ (-list '(())) => '(())
+ (-list '(() 1)) => '(() 1))
(defexamples -fix
(-fix (lambda (l) (-non-nil (--mapcat (-split-at (/ (length it) 2) it)
l))) '((1 2 3 4 5 6))) => '((1) (2) (3) (4) (5) (6))
- [elpa] externals/dash 3950c48 189/316: ; Fix typo in version of recent obsoletion, (continued)
- [elpa] externals/dash 3950c48 189/316: ; Fix typo in version of recent obsoletion, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 8a33835 191/316: .gitignore: Ignore second dir-locals-file., ELPA Syncer, 2021/02/15
- [elpa] externals/dash ba3fb62 203/316: More README copy-edits, ELPA Syncer, 2021/02/15
- [elpa] externals/dash fbc9e31 197/316: Merge branch externals/dash from GNU ELPA, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 2fb97f0 202/316: ; Fix typo in last change, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 9c6a7c3 207/316: Add Makefile, ELPA Syncer, 2021/02/15
- [elpa] externals/dash f2cd73d 211/316: Make --dotimes more hygienic, ELPA Syncer, 2021/02/15
- [elpa] externals/dash b34ddf5 210/316: Improve formatting of ellipses, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 8879c41 216/316: Use actual dash-functional.el version in README, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 5a64259 218/316: ; Move -doto/--doto next to other threading macros, ELPA Syncer, 2021/02/15
- [elpa] externals/dash b3c58ff 221/316: Fix docstring of -list,
ELPA Syncer <=
- [elpa] externals/dash 26f065f 129/316: Merge pull request #282 from yyoncho/anamorphic-doto, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 4abffdc 123/316: Update docs, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 677c156 134/316: Merge pull request #290 from leungbk/rotate, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 1549860 139/316: Merge pull request #296 from cireu/fix-hash-opt-expander, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 93e0465 137/316: Remove dependecy `macroexp`, ELPA Syncer, 2021/02/15
- [elpa] externals/dash a358b79 143/316: Speed up `-uniq` with hash-table., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 77f3bf4 142/316: Merge pull request #302 from bbatsov/patch-1, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 38dc929 222/316: Fix, improve, and extend anaphoric folds, ELPA Syncer, 2021/02/15
- [elpa] externals/dash d308676 225/316: Fix signal argument and case where start is null, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 994cda9 228/316: Simplify -cons-pair?, ELPA Syncer, 2021/02/15