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

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

[elpa] externals/compat 0ddf833ddf 1/2: Add bool-vector


From: ELPA Syncer
Subject: [elpa] externals/compat 0ddf833ddf 1/2: Add bool-vector
Date: Sat, 12 Mar 2022 13:57:22 -0500 (EST)

branch: externals/compat
commit 0ddf833ddfb355c6e92271df7be5d55f6a286cdf
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Add bool-vector
---
 compat-25.el | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/compat-25.el b/compat-25.el
index 713ebf2766..e90faa5611 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -31,6 +31,21 @@
 
 (eval-when-compile (require 'compat-macs))
 
+;;;; Defined in alloc.c
+
+(compat-defun bool-vector (&rest objects)
+  "Return a new bool-vector with specified arguments as elements.
+Allows any number of arguments, including zero.
+usage: (bool-vector &rest OBJECTS)"
+  (let ((vec (make-bool-vector (length objects) nil))
+        (i 0))
+    (while objects
+      (when (car objects)
+        (aset vec i t))
+      (setq objects (cdr objects)
+            i (1+ i)))
+    vec))
+
 ;;;; Defined in fns.c
 
 (compat-defun sort (seq predicate)



reply via email to

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