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

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

[elpa] externals/dash d308676 225/316: Fix signal argument and case wher


From: ELPA Syncer
Subject: [elpa] externals/dash d308676 225/316: Fix signal argument and case where start is null
Date: Mon, 15 Feb 2021 15:58:05 -0500 (EST)

branch: externals/dash
commit d30867607c80012dac297b70984c9fae5c11e0b6
Author: Mark Oteiza <mvoteiza@udel.edu>
Commit: Mark Oteiza <mvoteiza@udel.edu>

    Fix signal argument and case where start is null
    
    If either of the optional arguments are empty, just set them to the
    defaults.
---
 dash.el | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/dash.el b/dash.el
index afa5fad..375cc7d 100644
--- a/dash.el
+++ b/dash.el
@@ -2160,16 +2160,16 @@ 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."
-  (if (or (not (integerp count)) (< count 0))
-      (signal 'wrong-type-argument count))
-  (if (and step (zerop step)) (make-list count start)
-    (let ((res '())
-          (x (or start 0))
-          (dx (or step 1)))
+  (when (not (natnump count))
+    (signal 'wrong-type-argument (list #'natnump count)))
+  (or start (setq start 0))
+  (or step (setq step 1))
+  (if (zerop step) (make-list count start)
+    (let (result)
       (while (<= 0 (setq count (1- count)))
-        (push x res)
-        (setq x (+ x dx)))
-      (nreverse res))))
+        (push start result)
+        (setq start (+ start step)))
+      (nreverse result))))
 
 (defun -fix (fn list)
   "Compute the (least) fixpoint of FN with initial input LIST.



reply via email to

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