[Top][All Lists]

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

[elpa] externals/dash e4521af 136/439: Add -repeat

From: Phillip Lord
Subject: [elpa] externals/dash e4521af 136/439: Add -repeat
Date: Tue, 04 Aug 2015 20:27:13 +0000

branch: externals/dash
commit e4521af66729346c7356a983beced55903095a87
Author: vemv <address@hidden>
Commit: vemv <address@hidden>

    Add -repeat
 dash.el |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dash.el b/dash.el
index 2eebff8..b1b5896f 100644
--- a/dash.el
+++ b/dash.el
@@ -587,6 +587,13 @@ or with `-compare-fn' if that's non-nil."
           (setq lst (cdr lst)))
+(defun -repeat (n x)
+  "Return a list of N Xs."
+  (let ((ret nil))
+    (loop for i from 0 to (dec n) do
+         (setq ret (cons x ret)))
+    ret))
 (defalias '-contains-p '-contains?)
 (eval-after-load "lisp-mode"

reply via email to

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