[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash d98f5a0 235/316: Update for -iota
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dash d98f5a0 235/316: Update for -iota |
Date: |
Mon, 15 Feb 2021 15:58:08 -0500 (EST) |
branch: externals/dash
commit d98f5a02e28b26f85eab0e5d94c153e4d563aee6
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>
Update for -iota
* dash.el (-iota): Tiny simplification.
* dev/examples.el (-iota): Add more tests.
* README.md:
* dash.texi: Regenerate docs.
Re: #207.
---
README.md | 15 +++++++++++++++
dash.el | 2 +-
dash.texi | 24 ++++++++++++++++++++++++
dev/examples.el | 7 ++++++-
4 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 778fa2c..74d8c55 100644
--- a/README.md
+++ b/README.md
@@ -270,6 +270,7 @@ Other list functions not fit to be classified elsewhere.
* [-snoc](#-snoc-list-elem-rest-elements) `(list elem &rest elements)`
* [-interpose](#-interpose-sep-list) `(sep list)`
* [-interleave](#-interleave-rest-lists) `(&rest lists)`
+* [-iota](#-iota-count-optional-start-step) `(count &optional start step)`
* [-zip-with](#-zip-with-fn-list1-list2) `(fn list1 list2)`
* [-zip](#-zip-rest-lists) `(&rest lists)`
* [-zip-lists](#-zip-lists-rest-lists) `(&rest lists)`
@@ -1794,6 +1795,20 @@ Return a new list of the first item in each list, then
the second etc.
(-interleave '(1 2 3) '("a" "b")) ;; => '(1 "a" 2 "b")
```
+#### -iota `(count &optional start step)`
+
+Return a list containing `count` numbers.
+Starts from `start` and adds `step` each time. The default `start` is
+zero, the default `step` is 1.
+This function takes its name from the corresponding primitive in
+the `apl` language.
+
+```el
+(-iota 6) ;; => '(0 1 2 3 4 5)
+(-iota 4 2.5 -2) ;; => '(2.5 0.5 -1.5 -3.5)
+(-iota -1) ;; Error
+```
+
#### -zip-with `(fn list1 list2)`
Zip the two lists `list1` and `list2` using a function `fn`. This
diff --git a/dash.el b/dash.el
index e1c9aca..68d2749 100644
--- a/dash.el
+++ b/dash.el
@@ -2705,7 +2705,7 @@ Starts from START and adds STEP each time. The default
START is
zero, the default STEP is 1.
This function takes its name from the corresponding primitive in
the APL language."
- (when (not (natnump count))
+ (unless (natnump count)
(signal 'wrong-type-argument (list #'natnump count)))
(or start (setq start 0))
(or step (setq step 1))
diff --git a/dash.texi b/dash.texi
index 352e790..ee38333 100644
--- a/dash.texi
+++ b/dash.texi
@@ -2710,6 +2710,30 @@ Return a new list of the first item in each list, then
the second etc.
@end example
@end defun
+@anchor{-iota}
+@defun -iota (count &optional start step)
+Return a list containing @var{count} numbers.
+Starts from @var{start} and adds @var{step} each time. The default
@var{start} is
+zero, the default @var{step} is 1.
+This function takes its name from the corresponding primitive in
+the @var{apl} language.
+
+@example
+@group
+(-iota 6)
+ @result{} '(0 1 2 3 4 5)
+@end group
+@group
+(-iota 4 2.5 -2)
+ @result{} '(2.5 0.5 -1.5 -3.5)
+@end group
+@group
+(-iota -1)
+ @result{} wrong-type-argument
+@end group
+@end example
+@end defun
+
@anchor{-zip-with}
@defun -zip-with (fn list1 list2)
Zip the two lists @var{list1} and @var{list2} using a function @var{fn}. This
diff --git a/dev/examples.el b/dev/examples.el
index a0f1975..2ab60a7 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -882,7 +882,12 @@ value rather than consuming a list to produce a single
value."
(defexamples -iota
(-iota 6) => '(0 1 2 3 4 5)
(-iota 4 2.5 -2) => '(2.5 0.5 -1.5 -3.5)
- (-iota -1) !!> wrong-type-argument)
+ (-iota -1) !!> wrong-type-argument
+ (-iota 0) => ()
+ (-iota 0 nil 0) => ()
+ (-iota 1 nil 0) => '(0)
+ (-iota 1) => '(0)
+ (-iota 1 nil -1) => '(0))
(defexamples -zip-with
(-zip-with '+ '(1 2 3) '(4 5 6)) => '(5 7 9)
- [elpa] externals/dash c38b06f 291/316: Port some recent manual changes to README, (continued)
- [elpa] externals/dash c38b06f 291/316: Port some recent manual changes to README, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 47114ca 290/316: Make manual generation more consistent with README, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 3fa27c4 295/316: Make README's def-example-group more like manual's, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 4043f4e 305/316: Consolidate duplicated change logs in new NEWS.md, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 51d81a5 308/316: Avoid using dash.el functions in macro bodies, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 41b5681 310/316: Merge pull request #369 from blc/gut, ELPA Syncer, 2021/02/15
- [elpa] externals/dash cec8c0d 311/316: Rename approx-equal to more accurate approx=, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 4d40317 313/316: Update list of contributors, ELPA Syncer, 2021/02/15
- [elpa] externals/dash be4e939 314/316: ; Fix recent whitespace change in dev/examples.el., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 0e97578 316/316: Release dash 2.18.0 and dash-functional 1.3.0, ELPA Syncer, 2021/02/15
- [elpa] externals/dash d98f5a0 235/316: Update for -iota,
ELPA Syncer <=
- [elpa] externals/dash 0f13e5e 246/316: Prefer push over add-to-list, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 9703eac 249/316: ; Fix Edebug spec in last change, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 4fb9613 255/316: Avoid evaluating file-local variables, ELPA Syncer, 2021/02/15
- [elpa] externals/dash ff5ed7a 261/316: Extend -keep docs and tests, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 5d8de45 262/316: ; Fix recent typo in -filter & -remove docstrings, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 7fc72d9 263/316: Fix Markdown quoting, ELPA Syncer, 2021/02/15
- [elpa] externals/dash e5e5363 272/316: Merge pull request #367 from HKey/fix-handling-nil, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 8bd2887 269/316: Move pre-commit.sh under dev/, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 8599380 270/316: Optimize -is-prefix? and -is-suffix?, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 5362be7 275/316: Use actual advertised function signature in manual, ELPA Syncer, 2021/02/15