Mercurial > hg > xemacs-beta
annotate lisp/cl-extra.el @ 4678:b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
lisp/ChangeLog addition:
2009-08-11 Aidan Kehoe <kehoea@parhasard.net>
* cl-extra.el (ceiling*, floor*, round*, truncate*):
Implement these in terms of the C functions; mark them as
obsolete.
(mod*, rem*): Use #'nth-value with the C functions, not #'nth with
the CL emulation functions.
man/ChangeLog addition:
2009-08-11 Aidan Kehoe <kehoea@parhasard.net>
* lispref/numbers.texi (Bigfloat Basics):
Correct this documentation (ignoring for the moment that it breaks
off in mid-sentence).
tests/ChangeLog addition:
2009-08-11 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-tests.el:
Test the new Common Lisp-compatible rounding functions available in
C.
(generate-rounding-output): Provide a function useful for
generating the data for the rounding functions tests.
src/ChangeLog addition:
2009-08-11 Aidan Kehoe <kehoea@parhasard.net>
* floatfns.c (ROUNDING_CONVERT, CONVERT_WITH_NUMBER_TYPES)
(CONVERT_WITHOUT_NUMBER_TYPES, MAYBE_TWO_ARGS_BIGNUM)
(MAYBE_ONE_ARG_BIGNUM, MAYBE_TWO_ARGS_RATIO)
(MAYBE_ONE_ARG_RATIO, MAYBE_TWO_ARGS_BIGFLOAT)
(MAYBE_ONE_ARG_BIGFLOAT, MAYBE_EFF, MAYBE_CHAR_OR_MARKER):
New macros, used in the implementation of the rounding functions.
(ceiling_two_fixnum, ceiling_two_bignum, ceiling_two_ratio)
(ceiling_two_bigfloat, ceiling_one_ratio, ceiling_one_bigfloat)
(ceiling_two_float, ceiling_one_float, ceiling_one_mundane_arg)
(floor_two_fixnum, floor_two_bignum, floor_two_ratio)
(floor_two_bigfloat, floor_one_ratio, floor_one_bigfloat)
(floor_two_float, floor_one_mundane_arg, round_two_fixnum)
(round_two_bignum_1, round_two_bignum, round_two_ratio)
(round_one_bigfloat_1, round_two_bigfloat, round_one_ratio)
(round_one_bigfloat, round_two_float, round_one_float)
(round_one_mundane_arg, truncate_two_fixnum)
(truncate_two_bignum, truncate_two_ratio, truncate_two_bigfloat)
(truncate_one_ratio, truncate_one_bigfloat, truncate_two_float)
(truncate_one_float, truncate_one_mundane_arg):
New functions, used in the implementation of the rounding
functions.
(Fceiling, Ffloor, Fround, Ftruncate, Ffceiling, Fffloor)
(Ffround, Fftruncate):
Revise to fully support Common Lisp conventions. This means:
-- All functions have optional DIVISOR arguments
-- All functions return multiple values; see #'values
-- All functions do their arithmetic with the correct number types
according to the contamination rules.
-- #'round and #'fround always round towards the even number
in ambiguous cases.
* doprnt.c (emacs_doprnt_1):
* number.c (internal_coerce_number):
Call Ftruncate with two arguments, not one.
* floatfns.c (Ffloat):
Correct this, if NUMBER is a bignum.
* lisp.h:
Declare Ftruncate as taking two arguments.
* number.c:
Provide scratch_ratio2, init it appropriately.
* number.h:
Make scratch_ratio2 available.
* number.h (BIGFLOAT_ARITH_RETURN):
* number.h (BIGFLOAT_ARITH_RETURN1):
Correct these functions.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Tue, 11 Aug 2009 17:59:23 +0100 |
parents | ecf1ebac70d8 |
children | d0ea57eb3de4 |
rev | line source |
---|---|
613 | 1 ;;; cl-extra.el --- Common Lisp extensions for XEmacs Lisp (part two) |
428 | 2 |
2153 | 3 ;; Copyright (C) 1993,2000,2003 Free Software Foundation, Inc. |
801 | 4 ;; Copyright (C) 2002 Ben Wing. |
428 | 5 |
6 ;; Author: Dave Gillespie <daveg@synaptics.com> | |
7 ;; Maintainer: XEmacs Development Team | |
8 ;; Version: 2.02 | |
9 ;; Keywords: extensions, dumped | |
10 | |
11 ;; This file is part of XEmacs. | |
12 | |
13 ;; XEmacs is free software; you can redistribute it and/or modify it | |
14 ;; under the terms of the GNU General Public License as published by | |
15 ;; the Free Software Foundation; either version 2, or (at your option) | |
16 ;; any later version. | |
17 | |
18 ;; XEmacs is distributed in the hope that it will be useful, but | |
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
21 ;; General Public License for more details. | |
22 | |
23 ;; You should have received a copy of the GNU General Public License | |
24 ;; along with XEmacs; see the file COPYING. If not, write to the Free | |
25 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
26 ;; 02111-1307, USA. | |
27 | |
2153 | 28 ;;; Synched up with: FSF 21.3. |
428 | 29 |
30 ;;; Commentary: | |
31 | |
32 ;; This file is dumped with XEmacs. | |
33 | |
34 ;; These are extensions to Emacs Lisp that provide a degree of | |
35 ;; Common Lisp compatibility, beyond what is already built-in | |
36 ;; in Emacs Lisp. | |
37 ;; | |
38 ;; This package was written by Dave Gillespie; it is a complete | |
39 ;; rewrite of Cesar Quiroz's original cl.el package of December 1986. | |
40 ;; | |
41 ;; Bug reports, comments, and suggestions are welcome! | |
42 | |
43 ;; This file contains portions of the Common Lisp extensions | |
44 ;; package which are autoloaded since they are relatively obscure. | |
45 | |
46 ;; See cl.el for Change Log. | |
47 | |
48 | |
49 ;;; Code: | |
2153 | 50 ;; XEmacs addition |
428 | 51 (eval-when-compile |
52 (require 'obsolete)) | |
53 | |
54 (or (memq 'cl-19 features) | |
55 (error "Tried to load `cl-extra' before `cl'!")) | |
56 | |
57 | |
58 ;;; Type coercion. | |
59 | |
60 (defun coerce (x type) | |
61 "Coerce OBJECT to type TYPE. | |
62 TYPE is a Common Lisp type specifier." | |
63 (cond ((eq type 'list) (if (listp x) x (append x nil))) | |
64 ((eq type 'vector) (if (vectorp x) x (vconcat x))) | |
65 ((eq type 'string) (if (stringp x) x (concat x))) | |
66 ((eq type 'array) (if (arrayp x) x (vconcat x))) | |
67 ((and (eq type 'character) (stringp x) (= (length x) 1)) (aref x 0)) | |
68 ((and (eq type 'character) (symbolp x)) (coerce (symbol-name x) type)) | |
2153 | 69 ;; XEmacs addition character <-> integer coercions |
446 | 70 ((and (eq type 'character) (char-int-p x)) (int-char x)) |
71 ((and (eq type 'integer) (characterp x)) (char-int x)) | |
428 | 72 ((eq type 'float) (float x)) |
2153 | 73 ;; XEmacs addition: enhanced numeric type coercions |
2367 | 74 ((and-fboundp 'coerce-number |
75 (memq type '(integer ratio bigfloat)) | |
76 (coerce-number x type))) | |
2153 | 77 ;; XEmacs addition: bit-vector coercion |
428 | 78 ((eq type 'bit-vector) (if (bit-vector-p x) x |
79 (apply 'bit-vector (append x nil)))) | |
2153 | 80 ;; XEmacs addition: weak-list coercion |
428 | 81 ((eq type 'weak-list) |
82 (if (weak-list-p x) x | |
83 (let ((wl (make-weak-list))) | |
84 (set-weak-list-list wl (if (listp x) x (append x nil))) | |
85 wl))) | |
86 ((typep x type) x) | |
87 (t (error "Can't coerce %s to type %s" x type)))) | |
88 | |
89 | |
90 ;;; Predicates. | |
91 | |
92 (defun equalp (x y) | |
93 "Return t if two Lisp objects have similar structures and contents. | |
94 This is like `equal', except that it accepts numerically equal | |
95 numbers of different types (float vs. integer), and also compares | |
96 strings case-insensitively." | |
97 (cond ((eq x y) t) | |
98 ((stringp x) | |
2153 | 99 ;; XEmacs change: avoid downcase |
801 | 100 (eq t (compare-strings x nil nil y nil nil t))) |
2153 | 101 ;; XEmacs addition: compare characters |
428 | 102 ((characterp x) |
103 (and (characterp y) | |
104 (or (char-equal x y) | |
105 (char-equal (downcase x) (downcase y))))) | |
106 ((numberp x) | |
107 (and (numberp y) (= x y))) | |
108 ((consp x) | |
109 (while (and (consp x) (consp y) (equalp (car x) (car y))) | |
2153 | 110 (setq x (cdr x) y (cdr y))) |
428 | 111 (and (not (consp x)) (equalp x y))) |
112 ((vectorp x) | |
113 (and (vectorp y) (= (length x) (length y)) | |
114 (let ((i (length x))) | |
115 (while (and (>= (setq i (1- i)) 0) | |
116 (equalp (aref x i) (aref y i)))) | |
117 (< i 0)))) | |
118 (t (equal x y)))) | |
119 | |
120 | |
121 ;;; Control structures. | |
122 | |
123 (defun cl-mapcar-many (cl-func cl-seqs) | |
124 (if (cdr (cdr cl-seqs)) | |
125 (let* ((cl-res nil) | |
126 (cl-n (apply 'min (mapcar 'length cl-seqs))) | |
127 (cl-i 0) | |
128 (cl-args (copy-sequence cl-seqs)) | |
129 cl-p1 cl-p2) | |
130 (setq cl-seqs (copy-sequence cl-seqs)) | |
131 (while (< cl-i cl-n) | |
132 (setq cl-p1 cl-seqs cl-p2 cl-args) | |
133 (while cl-p1 | |
134 (setcar cl-p2 | |
135 (if (consp (car cl-p1)) | |
136 (prog1 (car (car cl-p1)) | |
137 (setcar cl-p1 (cdr (car cl-p1)))) | |
138 (aref (car cl-p1) cl-i))) | |
139 (setq cl-p1 (cdr cl-p1) cl-p2 (cdr cl-p2))) | |
2153 | 140 (push (apply cl-func cl-args) cl-res) |
428 | 141 (setq cl-i (1+ cl-i))) |
142 (nreverse cl-res)) | |
143 (let ((cl-res nil) | |
144 (cl-x (car cl-seqs)) | |
145 (cl-y (nth 1 cl-seqs))) | |
146 (let ((cl-n (min (length cl-x) (length cl-y))) | |
147 (cl-i -1)) | |
148 (while (< (setq cl-i (1+ cl-i)) cl-n) | |
2153 | 149 (push (funcall cl-func |
150 (if (consp cl-x) (pop cl-x) (aref cl-x cl-i)) | |
151 (if (consp cl-y) (pop cl-y) (aref cl-y cl-i))) | |
428 | 152 cl-res))) |
153 (nreverse cl-res)))) | |
154 | |
155 (defun map (cl-type cl-func cl-seq &rest cl-rest) | |
156 "Map a function across one or more sequences, returning a sequence. | |
157 TYPE is the sequence type to return, FUNC is the function, and SEQS | |
158 are the argument sequences." | |
159 (let ((cl-res (apply 'mapcar* cl-func cl-seq cl-rest))) | |
160 (and cl-type (coerce cl-res cl-type)))) | |
161 | |
162 (defun maplist (cl-func cl-list &rest cl-rest) | |
163 "Map FUNC to each sublist of LIST or LISTS. | |
164 Like `mapcar', except applies to lists and their cdr's rather than to | |
165 the elements themselves." | |
166 (if cl-rest | |
167 (let ((cl-res nil) | |
168 (cl-args (cons cl-list (copy-sequence cl-rest))) | |
169 cl-p) | |
170 (while (not (memq nil cl-args)) | |
2153 | 171 (push (apply cl-func cl-args) cl-res) |
428 | 172 (setq cl-p cl-args) |
2153 | 173 (while cl-p (setcar cl-p (cdr (pop cl-p)) ))) |
428 | 174 (nreverse cl-res)) |
175 (let ((cl-res nil)) | |
176 (while cl-list | |
2153 | 177 (push (funcall cl-func cl-list) cl-res) |
428 | 178 (setq cl-list (cdr cl-list))) |
179 (nreverse cl-res)))) | |
180 | |
2153 | 181 ;; XEmacs change: in Emacs, this function is named cl-mapc. |
428 | 182 (defun mapc (cl-func cl-seq &rest cl-rest) |
183 "Like `mapcar', but does not accumulate values returned by the function." | |
184 (if cl-rest | |
185 (apply 'map nil cl-func cl-seq cl-rest) | |
186 ;; XEmacs change: in the simplest case we call mapc-internal, | |
187 ;; which really doesn't accumulate any results. | |
188 (mapc-internal cl-func cl-seq)) | |
189 cl-seq) | |
190 | |
2153 | 191 ;; XEmacs addition: FSF compatibility |
192 (defalias 'cl-mapc 'mapc) | |
193 | |
428 | 194 (defun mapl (cl-func cl-list &rest cl-rest) |
195 "Like `maplist', but does not accumulate values returned by the function." | |
196 (if cl-rest | |
197 (apply 'maplist cl-func cl-list cl-rest) | |
198 (let ((cl-p cl-list)) | |
199 (while cl-p (funcall cl-func cl-p) (setq cl-p (cdr cl-p))))) | |
200 cl-list) | |
201 | |
202 (defun mapcan (cl-func cl-seq &rest cl-rest) | |
203 "Like `mapcar', but nconc's together the values returned by the function." | |
204 (apply 'nconc (apply 'mapcar* cl-func cl-seq cl-rest))) | |
205 | |
206 (defun mapcon (cl-func cl-list &rest cl-rest) | |
207 "Like `maplist', but nconc's together the values returned by the function." | |
208 (apply 'nconc (apply 'maplist cl-func cl-list cl-rest))) | |
209 | |
210 (defun some (cl-pred cl-seq &rest cl-rest) | |
211 "Return true if PREDICATE is true of any element of SEQ or SEQs. | |
212 If so, return the true (non-nil) value returned by PREDICATE." | |
213 (if (or cl-rest (nlistp cl-seq)) | |
214 (catch 'cl-some | |
215 (apply 'map nil | |
216 (function (lambda (&rest cl-x) | |
217 (let ((cl-res (apply cl-pred cl-x))) | |
218 (if cl-res (throw 'cl-some cl-res))))) | |
219 cl-seq cl-rest) nil) | |
220 (let ((cl-x nil)) | |
2153 | 221 (while (and cl-seq (not (setq cl-x (funcall cl-pred (pop cl-seq)))))) |
428 | 222 cl-x))) |
223 | |
224 (defun every (cl-pred cl-seq &rest cl-rest) | |
225 "Return true if PREDICATE is true of every element of SEQ or SEQs." | |
226 (if (or cl-rest (nlistp cl-seq)) | |
227 (catch 'cl-every | |
228 (apply 'map nil | |
229 (function (lambda (&rest cl-x) | |
230 (or (apply cl-pred cl-x) (throw 'cl-every nil)))) | |
231 cl-seq cl-rest) t) | |
232 (while (and cl-seq (funcall cl-pred (car cl-seq))) | |
233 (setq cl-seq (cdr cl-seq))) | |
234 (null cl-seq))) | |
235 | |
236 (defun notany (cl-pred cl-seq &rest cl-rest) | |
237 "Return true if PREDICATE is false of every element of SEQ or SEQs." | |
238 (not (apply 'some cl-pred cl-seq cl-rest))) | |
239 | |
240 (defun notevery (cl-pred cl-seq &rest cl-rest) | |
241 "Return true if PREDICATE is false of some element of SEQ or SEQs." | |
242 (not (apply 'every cl-pred cl-seq cl-rest))) | |
243 | |
244 ;;; Support for `loop'. | |
2153 | 245 (defalias 'cl-map-keymap 'map-keymap) |
428 | 246 |
247 (defun cl-map-keymap-recursively (cl-func-rec cl-map &optional cl-base) | |
248 (or cl-base | |
2153 | 249 (setq cl-base (copy-sequence [0]))) |
250 (map-keymap | |
428 | 251 (function |
252 (lambda (cl-key cl-bind) | |
253 (aset cl-base (1- (length cl-base)) cl-key) | |
254 (if (keymapp cl-bind) | |
255 (cl-map-keymap-recursively | |
256 cl-func-rec cl-bind | |
2153 | 257 (vconcat cl-base (list 0))) |
428 | 258 (funcall cl-func-rec cl-base cl-bind)))) |
259 cl-map)) | |
260 | |
261 (defun cl-map-intervals (cl-func &optional cl-what cl-prop cl-start cl-end) | |
262 (or cl-what (setq cl-what (current-buffer))) | |
263 (if (bufferp cl-what) | |
264 (let (cl-mark cl-mark2 (cl-next t) cl-next2) | |
2153 | 265 (with-current-buffer cl-what |
428 | 266 (setq cl-mark (copy-marker (or cl-start (point-min)))) |
267 (setq cl-mark2 (and cl-end (copy-marker cl-end)))) | |
268 (while (and cl-next (or (not cl-mark2) (< cl-mark cl-mark2))) | |
2153 | 269 (setq cl-next (if cl-prop (next-single-property-change |
270 cl-mark cl-prop cl-what) | |
271 (next-property-change cl-mark cl-what)) | |
272 cl-next2 (or cl-next (with-current-buffer cl-what | |
273 (point-max)))) | |
428 | 274 (funcall cl-func (prog1 (marker-position cl-mark) |
275 (set-marker cl-mark cl-next2)) | |
276 (if cl-mark2 (min cl-next2 cl-mark2) cl-next2))) | |
277 (set-marker cl-mark nil) (if cl-mark2 (set-marker cl-mark2 nil))) | |
278 (or cl-start (setq cl-start 0)) | |
279 (or cl-end (setq cl-end (length cl-what))) | |
280 (while (< cl-start cl-end) | |
2153 | 281 (let ((cl-next (or (if cl-prop (next-single-property-change |
282 cl-start cl-prop cl-what) | |
283 (next-property-change cl-start cl-what)) | |
428 | 284 cl-end))) |
285 (funcall cl-func cl-start (min cl-next cl-end)) | |
286 (setq cl-start cl-next))))) | |
287 | |
288 (defun cl-map-overlays (cl-func &optional cl-buffer cl-start cl-end cl-arg) | |
289 (or cl-buffer (setq cl-buffer (current-buffer))) | |
502 | 290 (with-fboundp '(overlay-start overlay-end overlays-at next-overlay-change) |
291 (if-fboundp 'overlay-lists | |
428 | 292 |
502 | 293 ;; This is the preferred algorithm, though overlay-lists is |
294 ;; undocumented. | |
295 (let (cl-ovl) | |
2153 | 296 (with-current-buffer cl-buffer |
502 | 297 (setq cl-ovl (overlay-lists)) |
298 (if cl-start (setq cl-start (copy-marker cl-start))) | |
299 (if cl-end (setq cl-end (copy-marker cl-end)))) | |
300 (setq cl-ovl (nconc (car cl-ovl) (cdr cl-ovl))) | |
301 (while (and cl-ovl | |
302 (or (not (overlay-start (car cl-ovl))) | |
303 (and cl-end (>= (overlay-start (car cl-ovl)) cl-end)) | |
304 (and cl-start (<= (overlay-end (car cl-ovl)) | |
305 cl-start)) | |
306 (not (funcall cl-func (car cl-ovl) cl-arg)))) | |
307 (setq cl-ovl (cdr cl-ovl))) | |
308 (if cl-start (set-marker cl-start nil)) | |
309 (if cl-end (set-marker cl-end nil))) | |
310 | |
311 ;; This alternate algorithm fails to find zero-length overlays. | |
2153 | 312 (let ((cl-mark (with-current-buffer cl-buffer |
313 (copy-marker (or cl-start (point-min))))) | |
314 (cl-mark2 (and cl-end (with-current-buffer cl-buffer | |
315 (copy-marker cl-end)))) | |
502 | 316 cl-pos cl-ovl) |
317 (while (save-excursion | |
318 (and (setq cl-pos (marker-position cl-mark)) | |
319 (< cl-pos (or cl-mark2 (point-max))) | |
320 (progn | |
321 (set-buffer cl-buffer) | |
322 (setq cl-ovl (overlays-at cl-pos)) | |
323 (set-marker cl-mark (next-overlay-change cl-pos))))) | |
324 (while (and cl-ovl | |
325 (or (/= (overlay-start (car cl-ovl)) cl-pos) | |
326 (not (and (funcall cl-func (car cl-ovl) cl-arg) | |
327 (set-marker cl-mark nil))))) | |
328 (setq cl-ovl (cdr cl-ovl)))) | |
329 (set-marker cl-mark nil) (if cl-mark2 (set-marker cl-mark2 nil)))))) | |
428 | 330 |
331 ;;; Support for `setf'. | |
332 (defun cl-set-frame-visible-p (frame val) | |
333 (cond ((null val) (make-frame-invisible frame)) | |
334 ((eq val 'icon) (iconify-frame frame)) | |
335 (t (make-frame-visible frame))) | |
336 val) | |
337 | |
338 ;;; Support for `progv'. | |
339 (defvar cl-progv-save) | |
340 (defun cl-progv-before (syms values) | |
341 (while syms | |
2153 | 342 (push (if (boundp (car syms)) |
428 | 343 (cons (car syms) (symbol-value (car syms))) |
344 (car syms)) cl-progv-save) | |
345 (if values | |
2153 | 346 (set (pop syms) (pop values)) |
347 (makunbound (pop syms))))) | |
428 | 348 |
349 (defun cl-progv-after () | |
350 (while cl-progv-save | |
351 (if (consp (car cl-progv-save)) | |
352 (set (car (car cl-progv-save)) (cdr (car cl-progv-save))) | |
353 (makunbound (car cl-progv-save))) | |
2153 | 354 (pop cl-progv-save))) |
428 | 355 |
356 | |
357 ;;; Numbers. | |
358 | |
359 (defun gcd (&rest args) | |
360 "Return the greatest common divisor of the arguments." | |
2153 | 361 (let ((a (abs (or (pop args) 0)))) |
428 | 362 (while args |
2153 | 363 (let ((b (abs (pop args)))) |
428 | 364 (while (> b 0) (setq b (% a (setq a b)))))) |
365 a)) | |
366 | |
367 (defun lcm (&rest args) | |
368 "Return the least common multiple of the arguments." | |
369 (if (memq 0 args) | |
370 0 | |
2153 | 371 (let ((a (abs (or (pop args) 1)))) |
428 | 372 (while args |
2153 | 373 (let ((b (abs (pop args)))) |
428 | 374 (setq a (* (/ a (gcd a b)) b)))) |
375 a))) | |
376 | |
377 (defun isqrt (a) | |
378 "Return the integer square root of the argument." | |
379 (if (and (integerp a) (> a 0)) | |
380 ;; XEmacs change | |
381 (let ((g (cond ((>= a 1000000) 10000) ((>= a 10000) 1000) | |
382 ((>= a 100) 100) (t 10))) | |
383 g2) | |
384 (while (< (setq g2 (/ (+ g (/ a g)) 2)) g) | |
385 (setq g g2)) | |
386 g) | |
387 (if (eq a 0) 0 (signal 'arith-error nil)))) | |
388 | |
2153 | 389 ;; XEmacs addition |
428 | 390 (defun cl-expt (x y) |
391 "Return X raised to the power of Y. Works only for integer arguments." | |
392 (if (<= y 0) (if (= y 0) 1 (if (memq x '(-1 1)) (cl-expt x (- y)) 0)) | |
393 (* (if (= (% y 2) 0) 1 x) (cl-expt (* x x) (/ y 2))))) | |
394 (or (and (fboundp 'expt) (subrp (symbol-function 'expt))) | |
395 (defalias 'expt 'cl-expt)) | |
396 | |
4678
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
397 ;; We can't use macrolet in this file; whence the literal macro |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
398 ;; definition-and-call: |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
399 ((macro . (lambda (&rest symbols) |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
400 "Make some old CL package truncate and round functions available. |
428 | 401 |
4678
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
402 These functions are now implemented in C; their Lisp implementations in this |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
403 XEmacs are trivial, so we provide them and mark them obsolete." |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
404 (let (symbol result) |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
405 (while symbols |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
406 (setq symbol (car symbols) |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
407 symbols (cdr symbols)) |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
408 (push `(make-obsolete ',(intern (format "%s*" symbol)) |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
409 ',symbol "21.5.29") |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
410 result) |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
411 (push |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
412 `(defun ,(intern (format "%s*" symbol)) (number &optional divisor) |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
413 ,(format "See `%s'. This returns a list, not multiple values." |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
414 symbol) |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
415 (multiple-value-list (,symbol number divisor))) |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
416 result)) |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
417 (cons 'progn result)))) |
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
418 ceiling floor round truncate) |
428 | 419 |
420 (defun mod* (x y) | |
421 "The remainder of X divided by Y, with the same sign as Y." | |
4678
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
422 (nth-value 1 (floor x y))) |
428 | 423 |
424 (defun rem* (x y) | |
425 "The remainder of X divided by Y, with the same sign as X." | |
4678
b5e1d4f6b66f
Make #'floor, #'ceiling, #'round, #'truncate conform to Common Lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
426 (nth-value 1 (truncate x y))) |
428 | 427 |
428 (defun signum (a) | |
429 "Return 1 if A is positive, -1 if negative, 0 if zero." | |
430 (cond ((> a 0) 1) ((< a 0) -1) (t 0))) | |
431 | |
432 ;; Random numbers. | |
433 | |
434 (defvar *random-state*) | |
435 (defun random* (lim &optional state) | |
436 "Return a random nonnegative number less than LIM, an integer or float. | |
437 Optional second arg STATE is a random-state object." | |
438 (or state (setq state *random-state*)) | |
439 ;; Inspired by "ran3" from Numerical Recipes. Additive congruential method. | |
440 (let ((vec (aref state 3))) | |
441 (if (integerp vec) | |
442 (let ((i 0) (j (- 1357335 (% (abs vec) 1357333))) (k 1)) | |
443 (aset state 3 (setq vec (make-vector 55 nil))) | |
444 (aset vec 0 j) | |
445 (while (> (setq i (% (+ i 21) 55)) 0) | |
446 (aset vec i (setq j (prog1 k (setq k (- j k)))))) | |
447 (while (< (setq i (1+ i)) 200) (random* 2 state)))) | |
448 (let* ((i (aset state 1 (% (1+ (aref state 1)) 55))) | |
449 (j (aset state 2 (% (1+ (aref state 2)) 55))) | |
450 (n (logand 8388607 (aset vec i (- (aref vec i) (aref vec j)))))) | |
451 (if (integerp lim) | |
452 (if (<= lim 512) (% n lim) | |
453 (if (> lim 8388607) (setq n (+ (lsh n 9) (random* 512 state)))) | |
454 (let ((mask 1023)) | |
455 (while (< mask (1- lim)) (setq mask (1+ (+ mask mask)))) | |
456 (if (< (setq n (logand n mask)) lim) n (random* lim state)))) | |
457 (* (/ n '8388608e0) lim))))) | |
458 | |
459 (defun make-random-state (&optional state) | |
460 "Return a copy of random-state STATE, or of `*random-state*' if omitted. | |
461 If STATE is t, return a new state object seeded from the time of day." | |
462 (cond ((null state) (make-random-state *random-state*)) | |
463 ((vectorp state) (cl-copy-tree state t)) | |
464 ((integerp state) (vector 'cl-random-state-tag -1 30 state)) | |
465 (t (make-random-state (cl-random-time))))) | |
466 | |
467 (defun random-state-p (object) | |
468 "Return t if OBJECT is a random-state object." | |
469 (and (vectorp object) (= (length object) 4) | |
470 (eq (aref object 0) 'cl-random-state-tag))) | |
471 | |
472 | |
473 ;; Implementation limits. | |
474 | |
475 (defun cl-finite-do (func a b) | |
476 (condition-case nil | |
477 (let ((res (funcall func a b))) ; check for IEEE infinity | |
478 (and (numberp res) (/= res (/ res 2)) res)) | |
479 (arith-error nil))) | |
480 | |
481 (defvar most-positive-float) | |
482 (defvar most-negative-float) | |
483 (defvar least-positive-float) | |
484 (defvar least-negative-float) | |
485 (defvar least-positive-normalized-float) | |
486 (defvar least-negative-normalized-float) | |
487 (defvar float-epsilon) | |
488 (defvar float-negative-epsilon) | |
489 | |
490 (defun cl-float-limits () | |
491 (or most-positive-float (not (numberp '2e1)) | |
492 (let ((x '2e0) y z) | |
493 ;; Find maximum exponent (first two loops are optimizations) | |
494 (while (cl-finite-do '* x x) (setq x (* x x))) | |
495 (while (cl-finite-do '* x (/ x 2)) (setq x (* x (/ x 2)))) | |
496 (while (cl-finite-do '+ x x) (setq x (+ x x))) | |
497 (setq z x y (/ x 2)) | |
498 ;; Now fill in 1's in the mantissa. | |
499 (while (and (cl-finite-do '+ x y) (/= (+ x y) x)) | |
500 (setq x (+ x y) y (/ y 2))) | |
501 (setq most-positive-float x | |
502 most-negative-float (- x)) | |
503 ;; Divide down until mantissa starts rounding. | |
504 (setq x (/ x z) y (/ 16 z) x (* x y)) | |
505 (while (condition-case nil (and (= x (* (/ x 2) 2)) (> (/ y 2) 0)) | |
506 (arith-error nil)) | |
507 (setq x (/ x 2) y (/ y 2))) | |
508 (setq least-positive-normalized-float y | |
509 least-negative-normalized-float (- y)) | |
510 ;; Divide down until value underflows to zero. | |
511 (setq x (/ 1 z) y x) | |
512 (while (condition-case nil (> (/ x 2) 0) (arith-error nil)) | |
513 (setq x (/ x 2))) | |
514 (setq least-positive-float x | |
515 least-negative-float (- x)) | |
516 (setq x '1e0) | |
517 (while (/= (+ '1e0 x) '1e0) (setq x (/ x 2))) | |
518 (setq float-epsilon (* x 2)) | |
519 (setq x '1e0) | |
520 (while (/= (- '1e0 x) '1e0) (setq x (/ x 2))) | |
521 (setq float-negative-epsilon (* x 2)))) | |
522 nil) | |
523 | |
524 | |
525 ;;; Sequence functions. | |
526 | |
527 ;XEmacs -- our built-in is more powerful. | |
528 ;(defun subseq (seq start &optional end) | |
529 ; "Return the subsequence of SEQ from START to END. | |
530 ;If END is omitted, it defaults to the length of the sequence. | |
531 ;If START or END is negative, it counts from the end." | |
532 ; (if (stringp seq) (substring seq start end) | |
533 ; (let (len) | |
534 ; (and end (< end 0) (setq end (+ end (setq len (length seq))))) | |
535 ; (if (< start 0) (setq start (+ start (or len (setq len (length seq)))))) | |
536 ; (cond ((listp seq) | |
537 ; (if (> start 0) (setq seq (nthcdr start seq))) | |
538 ; (if end | |
539 ; (let ((res nil)) | |
540 ; (while (>= (setq end (1- end)) start) | |
2153 | 541 ; (push (pop seq) res)) |
428 | 542 ; (nreverse res)) |
543 ; (copy-sequence seq))) | |
544 ; (t | |
545 ; (or end (setq end (or len (length seq)))) | |
546 ; (let ((res (make-vector (max (- end start) 0) nil)) | |
547 ; (i 0)) | |
548 ; (while (< start end) | |
549 ; (aset res i (aref seq start)) | |
550 ; (setq i (1+ i) start (1+ start))) | |
551 ; res)))))) | |
552 | |
553 (defun concatenate (type &rest seqs) | |
554 "Concatenate, into a sequence of type TYPE, the argument SEQUENCES." | |
2153 | 555 ;; XEmacs change: use case instead of cond for clarity |
428 | 556 (case type |
557 (vector (apply 'vconcat seqs)) | |
558 (string (apply 'concat seqs)) | |
559 (list (apply 'append (append seqs '(nil)))) | |
560 (t (error "Not a sequence type name: %s" type)))) | |
561 | |
562 ;;; List functions. | |
563 | |
564 (defun revappend (x y) | |
565 "Equivalent to (append (reverse X) Y)." | |
566 (nconc (reverse x) y)) | |
567 | |
568 (defun nreconc (x y) | |
569 "Equivalent to (nconc (nreverse X) Y)." | |
570 (nconc (nreverse x) y)) | |
571 | |
572 (defun list-length (x) | |
573 "Return the length of a list. Return nil if list is circular." | |
574 (let ((n 0) (fast x) (slow x)) | |
575 (while (and (cdr fast) (not (and (eq fast slow) (> n 0)))) | |
576 (setq n (+ n 2) fast (cdr (cdr fast)) slow (cdr slow))) | |
577 (if fast (if (cdr fast) nil (1+ n)) n))) | |
578 | |
579 (defun tailp (sublist list) | |
580 "Return true if SUBLIST is a tail of LIST." | |
581 (while (and (consp list) (not (eq sublist list))) | |
582 (setq list (cdr list))) | |
583 (if (numberp sublist) (equal sublist list) (eq sublist list))) | |
584 | |
2153 | 585 (defalias 'cl-copy-tree 'copy-tree) |
428 | 586 |
587 | |
588 ;;; Property lists. | |
589 | |
590 ;; XEmacs: our `get' groks DEFAULT. | |
591 (defalias 'get* 'get) | |
442 | 592 (defalias 'getf 'plist-get) |
428 | 593 |
594 (defun cl-set-getf (plist tag val) | |
595 (let ((p plist)) | |
596 (while (and p (not (eq (car p) tag))) (setq p (cdr (cdr p)))) | |
597 (if p (progn (setcar (cdr p) val) plist) (list* tag val plist)))) | |
598 | |
599 (defun cl-do-remf (plist tag) | |
600 (let ((p (cdr plist))) | |
601 (while (and (cdr p) (not (eq (car (cdr p)) tag))) (setq p (cdr (cdr p)))) | |
602 (and (cdr p) (progn (setcdr p (cdr (cdr (cdr p)))) t)))) | |
603 | |
2153 | 604 ;; XEmacs change: we have a builtin remprop |
605 (defalias 'cl-remprop 'remprop) | |
606 | |
607 | |
608 | |
428 | 609 ;;; Hash tables. |
610 | |
611 ;; The `regular' Common Lisp hash-table stuff has been moved into C. | |
612 ;; Only backward compatibility stuff remains here. | |
613 (defun make-hashtable (size &optional test) | |
614 (make-hash-table :test test :size size)) | |
615 (defun make-weak-hashtable (size &optional test) | |
616 (make-hash-table :test test :size size :weakness t)) | |
617 (defun make-key-weak-hashtable (size &optional test) | |
618 (make-hash-table :test test :size size :weakness 'key)) | |
619 (defun make-value-weak-hashtable (size &optional test) | |
620 (make-hash-table :test test :size size :weakness 'value)) | |
621 | |
622 (define-obsolete-function-alias 'hashtablep 'hash-table-p) | |
623 (define-obsolete-function-alias 'hashtable-fullness 'hash-table-count) | |
624 (define-obsolete-function-alias 'hashtable-test-function 'hash-table-test) | |
625 (define-obsolete-function-alias 'hashtable-type 'hash-table-type) | |
626 (define-obsolete-function-alias 'hashtable-size 'hash-table-size) | |
627 (define-obsolete-function-alias 'copy-hashtable 'copy-hash-table) | |
628 | |
629 (make-obsolete 'make-hashtable 'make-hash-table) | |
630 (make-obsolete 'make-weak-hashtable 'make-hash-table) | |
631 (make-obsolete 'make-key-weak-hashtable 'make-hash-table) | |
632 (make-obsolete 'make-value-weak-hashtable 'make-hash-table) | |
633 (make-obsolete 'hash-table-type 'hash-table-weakness) | |
634 | |
635 (when (fboundp 'x-keysym-hash-table) | |
636 (make-obsolete 'x-keysym-hashtable 'x-keysym-hash-table)) | |
637 | |
638 ;; Compatibility stuff for old kludgy cl.el hash table implementation | |
639 (defvar cl-builtin-gethash (symbol-function 'gethash)) | |
640 (defvar cl-builtin-remhash (symbol-function 'remhash)) | |
641 (defvar cl-builtin-clrhash (symbol-function 'clrhash)) | |
642 (defvar cl-builtin-maphash (symbol-function 'maphash)) | |
643 | |
644 (defalias 'cl-gethash 'gethash) | |
645 (defalias 'cl-puthash 'puthash) | |
646 (defalias 'cl-remhash 'remhash) | |
647 (defalias 'cl-clrhash 'clrhash) | |
648 (defalias 'cl-maphash 'maphash) | |
2153 | 649 ;; These three actually didn't exist in Emacs-20. |
650 (defalias 'cl-make-hash-table 'make-hash-table) | |
651 (defalias 'cl-hash-table-p 'hash-table-p) | |
652 (defalias 'cl-hash-table-count 'hash-table-count) | |
428 | 653 |
654 ;;; Some debugging aids. | |
655 | |
656 (defun cl-prettyprint (form) | |
657 "Insert a pretty-printed rendition of a Lisp FORM in current buffer." | |
658 (let ((pt (point)) last) | |
659 (insert "\n" (prin1-to-string form) "\n") | |
660 (setq last (point)) | |
661 (goto-char (1+ pt)) | |
662 (while (search-forward "(quote " last t) | |
663 (delete-backward-char 7) | |
664 (insert "'") | |
665 (forward-sexp) | |
666 (delete-char 1)) | |
667 (goto-char (1+ pt)) | |
668 (cl-do-prettyprint))) | |
669 | |
670 (defun cl-do-prettyprint () | |
671 (skip-chars-forward " ") | |
672 (if (looking-at "(") | |
1729 | 673 (let ((skip (or (looking-at "((") |
2153 | 674 ;; XEmacs: be selective about trailing stuff after prog |
1729 | 675 (looking-at "(prog[nv12\\(ress-feedback\\|n-with-message\\)]") |
428 | 676 (looking-at "(unwind-protect ") |
677 (looking-at "(function (") | |
678 (looking-at "(cl-block-wrapper "))) | |
679 (two (or (looking-at "(defun ") (looking-at "(defmacro "))) | |
680 (let (or (looking-at "(let\\*? ") (looking-at "(while "))) | |
681 (set (looking-at "(p?set[qf] "))) | |
682 (if (or skip let | |
683 (progn | |
684 (forward-sexp) | |
685 (and (>= (current-column) 78) (progn (backward-sexp) t)))) | |
686 (let ((nl t)) | |
687 (forward-char 1) | |
688 (cl-do-prettyprint) | |
689 (or skip (looking-at ")") (cl-do-prettyprint)) | |
690 (or (not two) (looking-at ")") (cl-do-prettyprint)) | |
691 (while (not (looking-at ")")) | |
692 (if set (setq nl (not nl))) | |
693 (if nl (insert "\n")) | |
694 (lisp-indent-line) | |
695 (cl-do-prettyprint)) | |
696 (forward-char 1)))) | |
697 (forward-sexp))) | |
698 | |
699 (defvar cl-macroexpand-cmacs nil) | |
700 (defvar cl-closure-vars nil) | |
701 | |
702 (defun cl-macroexpand-all (form &optional env) | |
703 "Expand all macro calls through a Lisp FORM. | |
704 This also does some trivial optimizations to make the form prettier." | |
705 (while (or (not (eq form (setq form (macroexpand form env)))) | |
706 (and cl-macroexpand-cmacs | |
707 (not (eq form (setq form (compiler-macroexpand form))))))) | |
708 (cond ((not (consp form)) form) | |
709 ((memq (car form) '(let let*)) | |
710 (if (null (nth 1 form)) | |
711 (cl-macroexpand-all (cons 'progn (cddr form)) env) | |
712 (let ((letf nil) (res nil) (lets (cadr form))) | |
713 (while lets | |
2153 | 714 (push (if (consp (car lets)) |
428 | 715 (let ((exp (cl-macroexpand-all (caar lets) env))) |
716 (or (symbolp exp) (setq letf t)) | |
717 (cons exp (cl-macroexpand-body (cdar lets) env))) | |
718 (let ((exp (cl-macroexpand-all (car lets) env))) | |
719 (if (symbolp exp) exp | |
720 (setq letf t) (list exp nil)))) res) | |
721 (setq lets (cdr lets))) | |
722 (list* (if letf (if (eq (car form) 'let) 'letf 'letf*) (car form)) | |
723 (nreverse res) (cl-macroexpand-body (cddr form) env))))) | |
724 ((eq (car form) 'cond) | |
725 (cons (car form) | |
726 (mapcar (function (lambda (x) (cl-macroexpand-body x env))) | |
727 (cdr form)))) | |
728 ((eq (car form) 'condition-case) | |
729 (list* (car form) (nth 1 form) (cl-macroexpand-all (nth 2 form) env) | |
730 (mapcar (function | |
731 (lambda (x) | |
732 (cons (car x) (cl-macroexpand-body (cdr x) env)))) | |
733 (cdddr form)))) | |
734 ((memq (car form) '(quote function)) | |
735 (if (eq (car-safe (nth 1 form)) 'lambda) | |
736 (let ((body (cl-macroexpand-body (cddadr form) env))) | |
737 (if (and cl-closure-vars (eq (car form) 'function) | |
738 (cl-expr-contains-any body cl-closure-vars)) | |
739 (let* ((new (mapcar 'gensym cl-closure-vars)) | |
740 (sub (pairlis cl-closure-vars new)) (decls nil)) | |
741 (while (or (stringp (car body)) | |
742 (eq (car-safe (car body)) 'interactive)) | |
2153 | 743 (push (list 'quote (pop body)) decls)) |
428 | 744 (put (car (last cl-closure-vars)) 'used t) |
745 (append | |
746 (list 'list '(quote lambda) '(quote (&rest --cl-rest--))) | |
747 (sublis sub (nreverse decls)) | |
748 (list | |
749 (list* 'list '(quote apply) | |
2153 | 750 ;; XEmacs: put a quote before the function |
428 | 751 (list 'list '(quote quote) |
752 (list 'function | |
753 (list* 'lambda | |
754 (append new (cadadr form)) | |
755 (sublis sub body)))) | |
756 (nconc (mapcar (function | |
757 (lambda (x) | |
758 (list 'list '(quote quote) x))) | |
759 cl-closure-vars) | |
760 '((quote --cl-rest--))))))) | |
761 (list (car form) (list* 'lambda (cadadr form) body)))) | |
762 (let ((found (assq (cadr form) env))) | |
2153 | 763 ;; XEmacs: cadr/caddr operate on nil without errors |
428 | 764 (if (eq (cadr (caddr found)) 'cl-labels-args) |
765 (cl-macroexpand-all (cadr (caddr (cadddr found))) env) | |
766 form)))) | |
767 ((memq (car form) '(defun defmacro)) | |
768 (list* (car form) (nth 1 form) (cl-macroexpand-body (cddr form) env))) | |
769 ((and (eq (car form) 'progn) (not (cddr form))) | |
770 (cl-macroexpand-all (nth 1 form) env)) | |
771 ((eq (car form) 'setq) | |
772 (let* ((args (cl-macroexpand-body (cdr form) env)) (p args)) | |
773 (while (and p (symbolp (car p))) (setq p (cddr p))) | |
774 (if p (cl-macroexpand-all (cons 'setf args)) (cons 'setq args)))) | |
775 (t (cons (car form) (cl-macroexpand-body (cdr form) env))))) | |
776 | |
777 (defun cl-macroexpand-body (body &optional env) | |
778 (mapcar (function (lambda (x) (cl-macroexpand-all x env))) body)) | |
779 | |
780 (defun cl-prettyexpand (form &optional full) | |
781 (message "Expanding...") | |
782 (let ((cl-macroexpand-cmacs full) (cl-compiling-file full) | |
783 (byte-compile-macro-environment nil)) | |
784 (setq form (cl-macroexpand-all form | |
785 (and (not full) '((block) (eval-when))))) | |
786 (message "Formatting...") | |
787 (prog1 (cl-prettyprint form) | |
788 (message "")))) | |
789 | |
790 | |
791 | |
792 (run-hooks 'cl-extra-load-hook) | |
793 | |
2153 | 794 ;; XEmacs addition |
428 | 795 (provide 'cl-extra) |
796 | |
2153 | 797 ;;; arch-tag: bcd03437-0871-43fb-a8f1-ad0e0b5427ed |
428 | 798 ;;; cl-extra.el ends here |