emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/dash 5614753 182/439: Fix bug with -partition-all-in-st


From: Phillip Lord
Subject: [elpa] externals/dash 5614753 182/439: Fix bug with -partition-all-in-steps
Date: Tue, 04 Aug 2015 20:27:43 +0000

branch: externals/dash
commit 5614753d737f038d9b2f64c7e601507cddabc1b2
Author: Magnar Sveen <address@hidden>
Commit: Magnar Sveen <address@hidden>

    Fix bug with -partition-all-in-steps
---
 dash.el         |    2 +-
 dev/examples.el |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dash.el b/dash.el
index 735f539..9bd721c 100644
--- a/dash.el
+++ b/dash.el
@@ -469,7 +469,7 @@ The last groups may contain less than N items."
 If there are not enough items to make the last group N-sized,
 those items are discarded."
   (let ((result (---partition-all-in-steps-reversed n step list)))
-    (while (< (length (car result)) n)
+    (while (and result (< (length (car result)) n))
       (!cdr result))
     (nreverse result)))
 
diff --git a/dev/examples.el b/dev/examples.el
index c6f99df..1f005b6 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -172,12 +172,14 @@
 (defexamples -partition-all-in-steps
   (-partition-all-in-steps 2 1 '(1 2 3 4)) => '((1 2) (2 3) (3 4) (4))
   (-partition-all-in-steps 3 2 '(1 2 3 4)) => '((1 2 3) (3 4))
-  (-partition-all-in-steps 3 2 '(1 2 3 4 5)) => '((1 2 3) (3 4 5) (5)))
+  (-partition-all-in-steps 3 2 '(1 2 3 4 5)) => '((1 2 3) (3 4 5) (5))
+  (-partition-all-in-steps 2 1 '(1)) => '((1)))
 
 (defexamples -partition-in-steps
   (-partition-in-steps 2 1 '(1 2 3 4)) => '((1 2) (2 3) (3 4))
   (-partition-in-steps 3 2 '(1 2 3 4)) => '((1 2 3))
-  (-partition-in-steps 3 2 '(1 2 3 4 5)) => '((1 2 3) (3 4 5)))
+  (-partition-in-steps 3 2 '(1 2 3 4 5)) => '((1 2 3) (3 4 5))
+  (-partition-in-steps 2 1 '(1)) => '())
 
 (defexamples -partition-all
   (-partition-all 2 '(1 2 3 4 5 6)) => '((1 2) (3 4) (5 6))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]