diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c index 7159d1fa747..e808c3d4bf3 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2174,6 +2174,25 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */) | |||
| 2174 | return bool_vector_fill (val, init); | 2174 | return bool_vector_fill (val, init); |
| 2175 | } | 2175 | } |
| 2176 | 2176 | ||
| 2177 | DEFUN ("bool-vector", Fbool_vector, Sbool_vector, 0, MANY, 0, | ||
| 2178 | doc: /* Return a new bool-vector with specified arguments as elements. | ||
| 2179 | Any number of arguments, even zero arguments, are allowed. | ||
| 2180 | Each argument should be either t or nil. | ||
| 2181 | usage: (bool-vector &rest OBJECTS) */) | ||
| 2182 | (ptrdiff_t nargs, Lisp_Object *args) | ||
| 2183 | { | ||
| 2184 | ptrdiff_t i; | ||
| 2185 | Lisp_Object vector; | ||
| 2186 | |||
| 2187 | for (i = 0; i < nargs; i++) | ||
| 2188 | CHECK_BOOLEAN (args[i]); | ||
| 2189 | |||
| 2190 | vector = make_uninit_bool_vector (nargs); | ||
| 2191 | for (i = 0; i < nargs; i++) | ||
| 2192 | bool_vector_set (vector, i, !NILP (args[i])); | ||
| 2193 | |||
| 2194 | return vector; | ||
| 2195 | } | ||
| 2177 | 2196 | ||
| 2178 | /* Make a string from NBYTES bytes at CONTENTS, and compute the number | 2197 | /* Make a string from NBYTES bytes at CONTENTS, and compute the number |
| 2179 | of characters from the contents. This string may be unibyte or | 2198 | of characters from the contents. This string may be unibyte or |
| @@ -7102,6 +7121,7 @@ The time is in seconds as a floating point value. */); | |||
| 7102 | defsubr (&Scons); | 7121 | defsubr (&Scons); |
| 7103 | defsubr (&Slist); | 7122 | defsubr (&Slist); |
| 7104 | defsubr (&Svector); | 7123 | defsubr (&Svector); |
| 7124 | defsubr (&Sbool_vector); | ||
| 7105 | defsubr (&Smake_byte_code); | 7125 | defsubr (&Smake_byte_code); |
| 7106 | defsubr (&Smake_list); | 7126 | defsubr (&Smake_list); |
| 7107 | defsubr (&Smake_vector); | 7127 | defsubr (&Smake_vector); |