125 |
|
|
126 |
|
|
127 |
(defun reduce (cl-func cl-seq &rest cl-keys) |
(defun reduce (cl-func cl-seq &rest cl-keys) |
128 |
"Reduce two-argument FUNCTION across SEQUENCE. |
"Reduce two-argument FUNCTION across SEQ. |
129 |
Keywords supported: :start :end :from-end :initial-value :key" |
\nKeywords supported: :start :end :from-end :initial-value :key |
130 |
|
\n(fn FUNCTION SEQ [KEYWORD VALUE]...)" |
131 |
(cl-parsing-keywords (:from-end (:start 0) :end :initial-value :key) () |
(cl-parsing-keywords (:from-end (:start 0) :end :initial-value :key) () |
132 |
(or (listp cl-seq) (setq cl-seq (append cl-seq nil))) |
(or (listp cl-seq) (setq cl-seq (append cl-seq nil))) |
133 |
(setq cl-seq (subseq cl-seq cl-start cl-end)) |
(setq cl-seq (subseq cl-seq cl-start cl-end)) |
146 |
|
|
147 |
(defun fill (seq item &rest cl-keys) |
(defun fill (seq item &rest cl-keys) |
148 |
"Fill the elements of SEQ with ITEM. |
"Fill the elements of SEQ with ITEM. |
149 |
Keywords supported: :start :end" |
\nKeywords supported: :start :end |
150 |
|
\n(fn SEQ ITEM [KEYWORD VALUE]...)" |
151 |
(cl-parsing-keywords ((:start 0) :end) () |
(cl-parsing-keywords ((:start 0) :end) () |
152 |
(if (listp seq) |
(if (listp seq) |
153 |
(let ((p (nthcdr cl-start seq)) |
(let ((p (nthcdr cl-start seq)) |
166 |
(defun replace (cl-seq1 cl-seq2 &rest cl-keys) |
(defun replace (cl-seq1 cl-seq2 &rest cl-keys) |
167 |
"Replace the elements of SEQ1 with the elements of SEQ2. |
"Replace the elements of SEQ1 with the elements of SEQ2. |
168 |
SEQ1 is destructively modified, then returned. |
SEQ1 is destructively modified, then returned. |
169 |
Keywords supported: :start1 :end1 :start2 :end2" |
\nKeywords supported: :start1 :end1 :start2 :end2 |
170 |
|
\n(fn SEQ1 SEQ2 [KEYWORD VALUE]...)" |
171 |
(cl-parsing-keywords ((:start1 0) :end1 (:start2 0) :end2) () |
(cl-parsing-keywords ((:start1 0) :end1 (:start2 0) :end2) () |
172 |
(if (and (eq cl-seq1 cl-seq2) (<= cl-start2 cl-start1)) |
(if (and (eq cl-seq1 cl-seq2) (<= cl-start2 cl-start1)) |
173 |
(or (= cl-start1 cl-start2) |
(or (= cl-start1 cl-start2) |
209 |
"Remove all occurrences of ITEM in SEQ. |
"Remove all occurrences of ITEM in SEQ. |
210 |
This is a non-destructive function; it makes a copy of SEQ if necessary |
This is a non-destructive function; it makes a copy of SEQ if necessary |
211 |
to avoid corrupting the original SEQ. |
to avoid corrupting the original SEQ. |
212 |
Keywords supported: :test :test-not :key :count :start :end :from-end" |
\nKeywords supported: :test :test-not :key :count :start :end :from-end |
213 |
|
\n(fn ITEM SEQ [KEYWORD VALUE]...)" |
214 |
(cl-parsing-keywords (:test :test-not :key :if :if-not :count :from-end |
(cl-parsing-keywords (:test :test-not :key :if :if-not :count :from-end |
215 |
(:start 0) :end) () |
(:start 0) :end) () |
216 |
(if (<= (or cl-count (setq cl-count 8000000)) 0) |
(if (<= (or cl-count (setq cl-count 8000000)) 0) |
254 |
"Remove all items satisfying PREDICATE in SEQ. |
"Remove all items satisfying PREDICATE in SEQ. |
255 |
This is a non-destructive function; it makes a copy of SEQ if necessary |
This is a non-destructive function; it makes a copy of SEQ if necessary |
256 |
to avoid corrupting the original SEQ. |
to avoid corrupting the original SEQ. |
257 |
Keywords supported: :key :count :start :end :from-end" |
\nKeywords supported: :key :count :start :end :from-end |
258 |
|
\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" |
259 |
(apply 'remove* nil cl-list :if cl-pred cl-keys)) |
(apply 'remove* nil cl-list :if cl-pred cl-keys)) |
260 |
|
|
261 |
(defun remove-if-not (cl-pred cl-list &rest cl-keys) |
(defun remove-if-not (cl-pred cl-list &rest cl-keys) |
262 |
"Remove all items not satisfying PREDICATE in SEQ. |
"Remove all items not satisfying PREDICATE in SEQ. |
263 |
This is a non-destructive function; it makes a copy of SEQ if necessary |
This is a non-destructive function; it makes a copy of SEQ if necessary |
264 |
to avoid corrupting the original SEQ. |
to avoid corrupting the original SEQ. |
265 |
Keywords supported: :key :count :start :end :from-end" |
\nKeywords supported: :key :count :start :end :from-end |
266 |
|
\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" |
267 |
(apply 'remove* nil cl-list :if-not cl-pred cl-keys)) |
(apply 'remove* nil cl-list :if-not cl-pred cl-keys)) |
268 |
|
|
269 |
(defun delete* (cl-item cl-seq &rest cl-keys) |
(defun delete* (cl-item cl-seq &rest cl-keys) |
270 |
"Remove all occurrences of ITEM in SEQ. |
"Remove all occurrences of ITEM in SEQ. |
271 |
This is a destructive function; it reuses the storage of SEQ whenever possible. |
This is a destructive function; it reuses the storage of SEQ whenever possible. |
272 |
Keywords supported: :test :test-not :key :count :start :end :from-end" |
\nKeywords supported: :test :test-not :key :count :start :end :from-end |
273 |
|
\n(fn ITEM SEQ [KEYWORD VALUE]...)" |
274 |
(cl-parsing-keywords (:test :test-not :key :if :if-not :count :from-end |
(cl-parsing-keywords (:test :test-not :key :if :if-not :count :from-end |
275 |
(:start 0) :end) () |
(:start 0) :end) () |
276 |
(if (<= (or cl-count (setq cl-count 8000000)) 0) |
(if (<= (or cl-count (setq cl-count 8000000)) 0) |
312 |
(defun delete-if (cl-pred cl-list &rest cl-keys) |
(defun delete-if (cl-pred cl-list &rest cl-keys) |
313 |
"Remove all items satisfying PREDICATE in SEQ. |
"Remove all items satisfying PREDICATE in SEQ. |
314 |
This is a destructive function; it reuses the storage of SEQ whenever possible. |
This is a destructive function; it reuses the storage of SEQ whenever possible. |
315 |
Keywords supported: :key :count :start :end :from-end" |
\nKeywords supported: :key :count :start :end :from-end |
316 |
|
\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" |
317 |
(apply 'delete* nil cl-list :if cl-pred cl-keys)) |
(apply 'delete* nil cl-list :if cl-pred cl-keys)) |
318 |
|
|
319 |
(defun delete-if-not (cl-pred cl-list &rest cl-keys) |
(defun delete-if-not (cl-pred cl-list &rest cl-keys) |
320 |
"Remove all items not satisfying PREDICATE in SEQ. |
"Remove all items not satisfying PREDICATE in SEQ. |
321 |
This is a destructive function; it reuses the storage of SEQ whenever possible. |
This is a destructive function; it reuses the storage of SEQ whenever possible. |
322 |
Keywords supported: :key :count :start :end :from-end" |
\nKeywords supported: :key :count :start :end :from-end |
323 |
|
\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" |
324 |
(apply 'delete* nil cl-list :if-not cl-pred cl-keys)) |
(apply 'delete* nil cl-list :if-not cl-pred cl-keys)) |
325 |
|
|
326 |
(defun remove-duplicates (cl-seq &rest cl-keys) |
(defun remove-duplicates (cl-seq &rest cl-keys) |
327 |
"Return a copy of SEQ with all duplicate elements removed. |
"Return a copy of SEQ with all duplicate elements removed. |
328 |
Keywords supported: :test :test-not :key :start :end :from-end" |
\nKeywords supported: :test :test-not :key :start :end :from-end |
329 |
|
\n(fn SEQ [KEYWORD VALUE]...)" |
330 |
(cl-delete-duplicates cl-seq cl-keys t)) |
(cl-delete-duplicates cl-seq cl-keys t)) |
331 |
|
|
332 |
(defun delete-duplicates (cl-seq &rest cl-keys) |
(defun delete-duplicates (cl-seq &rest cl-keys) |
333 |
"Remove all duplicate elements from SEQ (destructively). |
"Remove all duplicate elements from SEQ (destructively). |
334 |
Keywords supported: :test :test-not :key :start :end :from-end" |
\nKeywords supported: :test :test-not :key :start :end :from-end |
335 |
|
\n(fn SEQ [KEYWORD VALUE]...)" |
336 |
(cl-delete-duplicates cl-seq cl-keys nil)) |
(cl-delete-duplicates cl-seq cl-keys nil)) |
337 |
|
|
338 |
(defun cl-delete-duplicates (cl-seq cl-keys cl-copy) |
(defun cl-delete-duplicates (cl-seq cl-keys cl-copy) |
379 |
"Substitute NEW for OLD in SEQ. |
"Substitute NEW for OLD in SEQ. |
380 |
This is a non-destructive function; it makes a copy of SEQ if necessary |
This is a non-destructive function; it makes a copy of SEQ if necessary |
381 |
to avoid corrupting the original SEQ. |
to avoid corrupting the original SEQ. |
382 |
Keywords supported: :test :test-not :key :count :start :end :from-end" |
\nKeywords supported: :test :test-not :key :count :start :end :from-end |
383 |
|
\n(fn NEW OLD SEQ [KEYWORD VALUE]...)" |
384 |
(cl-parsing-keywords (:test :test-not :key :if :if-not :count |
(cl-parsing-keywords (:test :test-not :key :if :if-not :count |
385 |
(:start 0) :end :from-end) () |
(:start 0) :end :from-end) () |
386 |
(if (or (eq cl-old cl-new) |
(if (or (eq cl-old cl-new) |
400 |
"Substitute NEW for all items satisfying PREDICATE in SEQ. |
"Substitute NEW for all items satisfying PREDICATE in SEQ. |
401 |
This is a non-destructive function; it makes a copy of SEQ if necessary |
This is a non-destructive function; it makes a copy of SEQ if necessary |
402 |
to avoid corrupting the original SEQ. |
to avoid corrupting the original SEQ. |
403 |
Keywords supported: :key :count :start :end :from-end" |
\nKeywords supported: :key :count :start :end :from-end |
404 |
|
\n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" |
405 |
(apply 'substitute cl-new nil cl-list :if cl-pred cl-keys)) |
(apply 'substitute cl-new nil cl-list :if cl-pred cl-keys)) |
406 |
|
|
407 |
(defun substitute-if-not (cl-new cl-pred cl-list &rest cl-keys) |
(defun substitute-if-not (cl-new cl-pred cl-list &rest cl-keys) |
408 |
"Substitute NEW for all items not satisfying PREDICATE in SEQ. |
"Substitute NEW for all items not satisfying PREDICATE in SEQ. |
409 |
This is a non-destructive function; it makes a copy of SEQ if necessary |
This is a non-destructive function; it makes a copy of SEQ if necessary |
410 |
to avoid corrupting the original SEQ. |
to avoid corrupting the original SEQ. |
411 |
Keywords supported: :key :count :start :end :from-end" |
\nKeywords supported: :key :count :start :end :from-end |
412 |
|
\n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" |
413 |
(apply 'substitute cl-new nil cl-list :if-not cl-pred cl-keys)) |
(apply 'substitute cl-new nil cl-list :if-not cl-pred cl-keys)) |
414 |
|
|
415 |
(defun nsubstitute (cl-new cl-old cl-seq &rest cl-keys) |
(defun nsubstitute (cl-new cl-old cl-seq &rest cl-keys) |
416 |
"Substitute NEW for OLD in SEQ. |
"Substitute NEW for OLD in SEQ. |
417 |
This is a destructive function; it reuses the storage of SEQ whenever possible. |
This is a destructive function; it reuses the storage of SEQ whenever possible. |
418 |
Keywords supported: :test :test-not :key :count :start :end :from-end" |
\nKeywords supported: :test :test-not :key :count :start :end :from-end |
419 |
|
\n(fn NEW OLD SEQ [KEYWORD VALUE]...)" |
420 |
(cl-parsing-keywords (:test :test-not :key :if :if-not :count |
(cl-parsing-keywords (:test :test-not :key :if :if-not :count |
421 |
(:start 0) :end :from-end) () |
(:start 0) :end :from-end) () |
422 |
(or (eq cl-old cl-new) (<= (or cl-count (setq cl-count 8000000)) 0) |
(or (eq cl-old cl-new) (<= (or cl-count (setq cl-count 8000000)) 0) |
448 |
(defun nsubstitute-if (cl-new cl-pred cl-list &rest cl-keys) |
(defun nsubstitute-if (cl-new cl-pred cl-list &rest cl-keys) |
449 |
"Substitute NEW for all items satisfying PREDICATE in SEQ. |
"Substitute NEW for all items satisfying PREDICATE in SEQ. |
450 |
This is a destructive function; it reuses the storage of SEQ whenever possible. |
This is a destructive function; it reuses the storage of SEQ whenever possible. |
451 |
Keywords supported: :key :count :start :end :from-end" |
\nKeywords supported: :key :count :start :end :from-end |
452 |
|
\n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" |
453 |
(apply 'nsubstitute cl-new nil cl-list :if cl-pred cl-keys)) |
(apply 'nsubstitute cl-new nil cl-list :if cl-pred cl-keys)) |
454 |
|
|
455 |
(defun nsubstitute-if-not (cl-new cl-pred cl-list &rest cl-keys) |
(defun nsubstitute-if-not (cl-new cl-pred cl-list &rest cl-keys) |
456 |
"Substitute NEW for all items not satisfying PREDICATE in SEQ. |
"Substitute NEW for all items not satisfying PREDICATE in SEQ. |
457 |
This is a destructive function; it reuses the storage of SEQ whenever possible. |
This is a destructive function; it reuses the storage of SEQ whenever possible. |
458 |
Keywords supported: :key :count :start :end :from-end" |
\nKeywords supported: :key :count :start :end :from-end |
459 |
|
\n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" |
460 |
(apply 'nsubstitute cl-new nil cl-list :if-not cl-pred cl-keys)) |
(apply 'nsubstitute cl-new nil cl-list :if-not cl-pred cl-keys)) |
461 |
|
|
462 |
(defun find (cl-item cl-seq &rest cl-keys) |
(defun find (cl-item cl-seq &rest cl-keys) |
463 |
"Find the first occurrence of ITEM in LIST. |
"Find the first occurrence of ITEM in SEQ. |
464 |
Return the matching ITEM, or nil if not found. |
Return the matching ITEM, or nil if not found. |
465 |
Keywords supported: :test :test-not :key :start :end :from-end" |
\nKeywords supported: :test :test-not :key :start :end :from-end |
466 |
|
\n(fn ITEM SEQ [KEYWORD VALUE]...)" |
467 |
(let ((cl-pos (apply 'position cl-item cl-seq cl-keys))) |
(let ((cl-pos (apply 'position cl-item cl-seq cl-keys))) |
468 |
(and cl-pos (elt cl-seq cl-pos)))) |
(and cl-pos (elt cl-seq cl-pos)))) |
469 |
|
|
470 |
(defun find-if (cl-pred cl-list &rest cl-keys) |
(defun find-if (cl-pred cl-list &rest cl-keys) |
471 |
"Find the first item satisfying PREDICATE in LIST. |
"Find the first item satisfying PREDICATE in SEQ. |
472 |
Return the matching ITEM, or nil if not found. |
Return the matching item, or nil if not found. |
473 |
Keywords supported: :key :start :end :from-end" |
\nKeywords supported: :key :start :end :from-end |
474 |
|
\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" |
475 |
(apply 'find nil cl-list :if cl-pred cl-keys)) |
(apply 'find nil cl-list :if cl-pred cl-keys)) |
476 |
|
|
477 |
(defun find-if-not (cl-pred cl-list &rest cl-keys) |
(defun find-if-not (cl-pred cl-list &rest cl-keys) |
478 |
"Find the first item not satisfying PREDICATE in LIST. |
"Find the first item not satisfying PREDICATE in SEQ. |
479 |
Return the matching ITEM, or nil if not found. |
Return the matching item, or nil if not found. |
480 |
Keywords supported: :key :start :end :from-end" |
\nKeywords supported: :key :start :end :from-end |
481 |
|
\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" |
482 |
(apply 'find nil cl-list :if-not cl-pred cl-keys)) |
(apply 'find nil cl-list :if-not cl-pred cl-keys)) |
483 |
|
|
484 |
(defun position (cl-item cl-seq &rest cl-keys) |
(defun position (cl-item cl-seq &rest cl-keys) |
485 |
"Find the first occurrence of ITEM in LIST. |
"Find the first occurrence of ITEM in SEQ. |
486 |
Return the index of the matching item, or nil if not found. |
Return the index of the matching item, or nil if not found. |
487 |
Keywords supported: :test :test-not :key :start :end :from-end" |
\nKeywords supported: :test :test-not :key :start :end :from-end |
488 |
|
\n(fn ITEM SEQ [KEYWORD VALUE]...)" |
489 |
(cl-parsing-keywords (:test :test-not :key :if :if-not |
(cl-parsing-keywords (:test :test-not :key :if :if-not |
490 |
(:start 0) :end :from-end) () |
(:start 0) :end :from-end) () |
491 |
(cl-position cl-item cl-seq cl-start cl-end cl-from-end))) |
(cl-position cl-item cl-seq cl-start cl-end cl-from-end))) |
512 |
(and (< cl-start cl-end) cl-start)))) |
(and (< cl-start cl-end) cl-start)))) |
513 |
|
|
514 |
(defun position-if (cl-pred cl-list &rest cl-keys) |
(defun position-if (cl-pred cl-list &rest cl-keys) |
515 |
"Find the first item satisfying PREDICATE in LIST. |
"Find the first item satisfying PREDICATE in SEQ. |
516 |
Return the index of the matching item, or nil if not found. |
Return the index of the matching item, or nil if not found. |
517 |
Keywords supported: :key :start :end :from-end" |
\nKeywords supported: :key :start :end :from-end |
518 |
|
\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" |
519 |
(apply 'position nil cl-list :if cl-pred cl-keys)) |
(apply 'position nil cl-list :if cl-pred cl-keys)) |
520 |
|
|
521 |
(defun position-if-not (cl-pred cl-list &rest cl-keys) |
(defun position-if-not (cl-pred cl-list &rest cl-keys) |
522 |
"Find the first item not satisfying PREDICATE in LIST. |
"Find the first item not satisfying PREDICATE in SEQ. |
523 |
Return the index of the matching item, or nil if not found. |
Return the index of the matching item, or nil if not found. |
524 |
Keywords supported: :key :start :end :from-end" |
\nKeywords supported: :key :start :end :from-end |
525 |
|
\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" |
526 |
(apply 'position nil cl-list :if-not cl-pred cl-keys)) |
(apply 'position nil cl-list :if-not cl-pred cl-keys)) |
527 |
|
|
528 |
(defun count (cl-item cl-seq &rest cl-keys) |
(defun count (cl-item cl-seq &rest cl-keys) |
529 |
"Count the number of occurrences of ITEM in LIST. |
"Count the number of occurrences of ITEM in SEQ. |
530 |
Keywords supported: :test :test-not :key :start :end" |
\nKeywords supported: :test :test-not :key :start :end |
531 |
|
\n(fn ITEM SEQ [KEYWORD VALUE]...)" |
532 |
(cl-parsing-keywords (:test :test-not :key :if :if-not (:start 0) :end) () |
(cl-parsing-keywords (:test :test-not :key :if :if-not (:start 0) :end) () |
533 |
(let ((cl-count 0) cl-x) |
(let ((cl-count 0) cl-x) |
534 |
(or cl-end (setq cl-end (length cl-seq))) |
(or cl-end (setq cl-end (length cl-seq))) |
540 |
cl-count))) |
cl-count))) |
541 |
|
|
542 |
(defun count-if (cl-pred cl-list &rest cl-keys) |
(defun count-if (cl-pred cl-list &rest cl-keys) |
543 |
"Count the number of items satisfying PREDICATE in LIST. |
"Count the number of items satisfying PREDICATE in SEQ. |
544 |
Keywords supported: :key :start :end" |
\nKeywords supported: :key :start :end |
545 |
|
\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" |
546 |
(apply 'count nil cl-list :if cl-pred cl-keys)) |
(apply 'count nil cl-list :if cl-pred cl-keys)) |
547 |
|
|
548 |
(defun count-if-not (cl-pred cl-list &rest cl-keys) |
(defun count-if-not (cl-pred cl-list &rest cl-keys) |
549 |
"Count the number of items not satisfying PREDICATE in LIST. |
"Count the number of items not satisfying PREDICATE in SEQ. |
550 |
Keywords supported: :key :start :end" |
\nKeywords supported: :key :start :end |
551 |
|
\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" |
552 |
(apply 'count nil cl-list :if-not cl-pred cl-keys)) |
(apply 'count nil cl-list :if-not cl-pred cl-keys)) |
553 |
|
|
554 |
(defun mismatch (cl-seq1 cl-seq2 &rest cl-keys) |
(defun mismatch (cl-seq1 cl-seq2 &rest cl-keys) |
555 |
"Compare SEQ1 with SEQ2, return index of first mismatching element. |
"Compare SEQ1 with SEQ2, return index of first mismatching element. |
556 |
Return nil if the sequences match. If one sequence is a prefix of the |
Return nil if the sequences match. If one sequence is a prefix of the |
557 |
other, the return value indicates the end of the shorter sequence. |
other, the return value indicates the end of the shorter sequence. |
558 |
Keywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end" |
\nKeywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end |
559 |
|
\n(fn SEQ1 SEQ2 [KEYWORD VALUE]...)" |
560 |
(cl-parsing-keywords (:test :test-not :key :from-end |
(cl-parsing-keywords (:test :test-not :key :from-end |
561 |
(:start1 0) :end1 (:start2 0) :end2) () |
(:start1 0) :end1 (:start2 0) :end2) () |
562 |
(or cl-end1 (setq cl-end1 (length cl-seq1))) |
(or cl-end1 (setq cl-end1 (length cl-seq1))) |
585 |
"Search for SEQ1 as a subsequence of SEQ2. |
"Search for SEQ1 as a subsequence of SEQ2. |
586 |
Return the index of the leftmost element of the first match found; |
Return the index of the leftmost element of the first match found; |
587 |
return nil if there are no matches. |
return nil if there are no matches. |
588 |
Keywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end" |
\nKeywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end |
589 |
|
\n(fn SEQ1 SEQ2 [KEYWORD VALUE]...)" |
590 |
(cl-parsing-keywords (:test :test-not :key :from-end |
(cl-parsing-keywords (:test :test-not :key :from-end |
591 |
(:start1 0) :end1 (:start2 0) :end2) () |
(:start1 0) :end1 (:start2 0) :end2) () |
592 |
(or cl-end1 (setq cl-end1 (length cl-seq1))) |
(or cl-end1 (setq cl-end1 (length cl-seq1))) |
608 |
(and (< cl-start2 cl-end2) cl-pos))))) |
(and (< cl-start2 cl-end2) cl-pos))))) |
609 |
|
|
610 |
(defun sort* (cl-seq cl-pred &rest cl-keys) |
(defun sort* (cl-seq cl-pred &rest cl-keys) |
611 |
"Sort the argument SEQUENCE according to PREDICATE. |
"Sort the argument SEQ according to PREDICATE. |
612 |
This is a destructive function; it reuses the storage of SEQUENCE if possible. |
This is a destructive function; it reuses the storage of SEQ if possible. |
613 |
Keywords supported: :key" |
\nKeywords supported: :key |
614 |
|
\n(fn SEQ PREDICATE [KEYWORD VALUE]...)" |
615 |
(if (nlistp cl-seq) |
(if (nlistp cl-seq) |
616 |
(replace cl-seq (apply 'sort* (append cl-seq nil) cl-pred cl-keys)) |
(replace cl-seq (apply 'sort* (append cl-seq nil) cl-pred cl-keys)) |
617 |
(cl-parsing-keywords (:key) () |
(cl-parsing-keywords (:key) () |
622 |
(funcall cl-key cl-y))))))))) |
(funcall cl-key cl-y))))))))) |
623 |
|
|
624 |
(defun stable-sort (cl-seq cl-pred &rest cl-keys) |
(defun stable-sort (cl-seq cl-pred &rest cl-keys) |
625 |
"Sort the argument SEQUENCE stably according to PREDICATE. |
"Sort the argument SEQ stably according to PREDICATE. |
626 |
This is a destructive function; it reuses the storage of SEQUENCE if possible. |
This is a destructive function; it reuses the storage of SEQ if possible. |
627 |
Keywords supported: :key" |
\nKeywords supported: :key |
628 |
|
\n(fn SEQ PREDICATE [KEYWORD VALUE]...)" |
629 |
(apply 'sort* cl-seq cl-pred cl-keys)) |
(apply 'sort* cl-seq cl-pred cl-keys)) |
630 |
|
|
631 |
(defun merge (cl-type cl-seq1 cl-seq2 cl-pred &rest cl-keys) |
(defun merge (cl-type cl-seq1 cl-seq2 cl-pred &rest cl-keys) |
632 |
"Destructively merge the two sequences to produce a new sequence. |
"Destructively merge the two sequences to produce a new sequence. |
633 |
TYPE is the sequence type to return, SEQ1 and SEQ2 are the two |
TYPE is the sequence type to return, SEQ1 and SEQ2 are the two argument |
634 |
argument sequences, and PRED is a `less-than' predicate on the elements. |
sequences, and PREDICATE is a `less-than' predicate on the elements. |
635 |
Keywords supported: :key" |
\nKeywords supported: :key |
636 |
|
\n(fn TYPE SEQ1 SEQ2 PREDICATE [KEYWORD VALUE]...)" |
637 |
(or (listp cl-seq1) (setq cl-seq1 (append cl-seq1 nil))) |
(or (listp cl-seq1) (setq cl-seq1 (append cl-seq1 nil))) |
638 |
(or (listp cl-seq2) (setq cl-seq2 (append cl-seq2 nil))) |
(or (listp cl-seq2) (setq cl-seq2 (append cl-seq2 nil))) |
639 |
(cl-parsing-keywords (:key) () |
(cl-parsing-keywords (:key) () |
649 |
(defun member* (cl-item cl-list &rest cl-keys) |
(defun member* (cl-item cl-list &rest cl-keys) |
650 |
"Find the first occurrence of ITEM in LIST. |
"Find the first occurrence of ITEM in LIST. |
651 |
Return the sublist of LIST whose car is ITEM. |
Return the sublist of LIST whose car is ITEM. |
652 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
653 |
|
\n(fn ITEM LIST [KEYWORD VALUE]...)" |
654 |
(if cl-keys |
(if cl-keys |
655 |
(cl-parsing-keywords (:test :test-not :key :if :if-not) () |
(cl-parsing-keywords (:test :test-not :key :if :if-not) () |
656 |
(while (and cl-list (not (cl-check-test cl-item (car cl-list)))) |
(while (and cl-list (not (cl-check-test cl-item (car cl-list)))) |
663 |
(defun member-if (cl-pred cl-list &rest cl-keys) |
(defun member-if (cl-pred cl-list &rest cl-keys) |
664 |
"Find the first item satisfying PREDICATE in LIST. |
"Find the first item satisfying PREDICATE in LIST. |
665 |
Return the sublist of LIST whose car matches. |
Return the sublist of LIST whose car matches. |
666 |
Keywords supported: :key" |
\nKeywords supported: :key |
667 |
|
\n(fn PREDICATE LIST [KEYWORD VALUE]...)" |
668 |
(apply 'member* nil cl-list :if cl-pred cl-keys)) |
(apply 'member* nil cl-list :if cl-pred cl-keys)) |
669 |
|
|
670 |
(defun member-if-not (cl-pred cl-list &rest cl-keys) |
(defun member-if-not (cl-pred cl-list &rest cl-keys) |
671 |
"Find the first item not satisfying PREDICATE in LIST. |
"Find the first item not satisfying PREDICATE in LIST. |
672 |
Return the sublist of LIST whose car matches. |
Return the sublist of LIST whose car matches. |
673 |
Keywords supported: :key" |
\nKeywords supported: :key |
674 |
|
\n(fn PREDICATE LIST [KEYWORD VALUE]...)" |
675 |
(apply 'member* nil cl-list :if-not cl-pred cl-keys)) |
(apply 'member* nil cl-list :if-not cl-pred cl-keys)) |
676 |
|
|
677 |
(defun cl-adjoin (cl-item cl-list &rest cl-keys) |
(defun cl-adjoin (cl-item cl-list &rest cl-keys) |
683 |
;;; See compiler macro in cl-macs.el |
;;; See compiler macro in cl-macs.el |
684 |
(defun assoc* (cl-item cl-alist &rest cl-keys) |
(defun assoc* (cl-item cl-alist &rest cl-keys) |
685 |
"Find the first item whose car matches ITEM in LIST. |
"Find the first item whose car matches ITEM in LIST. |
686 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
687 |
|
\n(fn ITEM LIST [KEYWORD VALUE]...)" |
688 |
(if cl-keys |
(if cl-keys |
689 |
(cl-parsing-keywords (:test :test-not :key :if :if-not) () |
(cl-parsing-keywords (:test :test-not :key :if :if-not) () |
690 |
(while (and cl-alist |
(while (and cl-alist |
698 |
|
|
699 |
(defun assoc-if (cl-pred cl-list &rest cl-keys) |
(defun assoc-if (cl-pred cl-list &rest cl-keys) |
700 |
"Find the first item whose car satisfies PREDICATE in LIST. |
"Find the first item whose car satisfies PREDICATE in LIST. |
701 |
Keywords supported: :key" |
\nKeywords supported: :key |
702 |
|
\n(fn PREDICATE LIST [KEYWORD VALUE]...)" |
703 |
(apply 'assoc* nil cl-list :if cl-pred cl-keys)) |
(apply 'assoc* nil cl-list :if cl-pred cl-keys)) |
704 |
|
|
705 |
(defun assoc-if-not (cl-pred cl-list &rest cl-keys) |
(defun assoc-if-not (cl-pred cl-list &rest cl-keys) |
706 |
"Find the first item whose car does not satisfy PREDICATE in LIST. |
"Find the first item whose car does not satisfy PREDICATE in LIST. |
707 |
Keywords supported: :key" |
\nKeywords supported: :key |
708 |
|
\n(fn PREDICATE LIST [KEYWORD VALUE]...)" |
709 |
(apply 'assoc* nil cl-list :if-not cl-pred cl-keys)) |
(apply 'assoc* nil cl-list :if-not cl-pred cl-keys)) |
710 |
|
|
711 |
(defun rassoc* (cl-item cl-alist &rest cl-keys) |
(defun rassoc* (cl-item cl-alist &rest cl-keys) |
712 |
"Find the first item whose cdr matches ITEM in LIST. |
"Find the first item whose cdr matches ITEM in LIST. |
713 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
714 |
|
\n(fn ITEM LIST [KEYWORD VALUE]...)" |
715 |
(if (or cl-keys (numberp cl-item)) |
(if (or cl-keys (numberp cl-item)) |
716 |
(cl-parsing-keywords (:test :test-not :key :if :if-not) () |
(cl-parsing-keywords (:test :test-not :key :if :if-not) () |
717 |
(while (and cl-alist |
(while (and cl-alist |
723 |
|
|
724 |
(defun rassoc-if (cl-pred cl-list &rest cl-keys) |
(defun rassoc-if (cl-pred cl-list &rest cl-keys) |
725 |
"Find the first item whose cdr satisfies PREDICATE in LIST. |
"Find the first item whose cdr satisfies PREDICATE in LIST. |
726 |
Keywords supported: :key" |
\nKeywords supported: :key |
727 |
|
\n(fn PREDICATE LIST [KEYWORD VALUE]...)" |
728 |
(apply 'rassoc* nil cl-list :if cl-pred cl-keys)) |
(apply 'rassoc* nil cl-list :if cl-pred cl-keys)) |
729 |
|
|
730 |
(defun rassoc-if-not (cl-pred cl-list &rest cl-keys) |
(defun rassoc-if-not (cl-pred cl-list &rest cl-keys) |
731 |
"Find the first item whose cdr does not satisfy PREDICATE in LIST. |
"Find the first item whose cdr does not satisfy PREDICATE in LIST. |
732 |
Keywords supported: :key" |
\nKeywords supported: :key |
733 |
|
\n(fn PREDICATE LIST [KEYWORD VALUE]...)" |
734 |
(apply 'rassoc* nil cl-list :if-not cl-pred cl-keys)) |
(apply 'rassoc* nil cl-list :if-not cl-pred cl-keys)) |
735 |
|
|
736 |
(defun union (cl-list1 cl-list2 &rest cl-keys) |
(defun union (cl-list1 cl-list2 &rest cl-keys) |
738 |
The result list contains all items that appear in either LIST1 or LIST2. |
The result list contains all items that appear in either LIST1 or LIST2. |
739 |
This is a non-destructive function; it makes a copy of the data if necessary |
This is a non-destructive function; it makes a copy of the data if necessary |
740 |
to avoid corrupting the original LIST1 and LIST2. |
to avoid corrupting the original LIST1 and LIST2. |
741 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
742 |
|
\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" |
743 |
(cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1) |
(cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1) |
744 |
((equal cl-list1 cl-list2) cl-list1) |
((equal cl-list1 cl-list2) cl-list1) |
745 |
(t |
(t |
758 |
The result list contains all items that appear in either LIST1 or LIST2. |
The result list contains all items that appear in either LIST1 or LIST2. |
759 |
This is a destructive function; it reuses the storage of LIST1 and LIST2 |
This is a destructive function; it reuses the storage of LIST1 and LIST2 |
760 |
whenever possible. |
whenever possible. |
761 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
762 |
|
\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" |
763 |
(cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1) |
(cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1) |
764 |
(t (apply 'union cl-list1 cl-list2 cl-keys)))) |
(t (apply 'union cl-list1 cl-list2 cl-keys)))) |
765 |
|
|
768 |
The result list contains all items that appear in both LIST1 and LIST2. |
The result list contains all items that appear in both LIST1 and LIST2. |
769 |
This is a non-destructive function; it makes a copy of the data if necessary |
This is a non-destructive function; it makes a copy of the data if necessary |
770 |
to avoid corrupting the original LIST1 and LIST2. |
to avoid corrupting the original LIST1 and LIST2. |
771 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
772 |
|
\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" |
773 |
(and cl-list1 cl-list2 |
(and cl-list1 cl-list2 |
774 |
(if (equal cl-list1 cl-list2) cl-list1 |
(if (equal cl-list1 cl-list2) cl-list1 |
775 |
(cl-parsing-keywords (:key) (:test :test-not) |
(cl-parsing-keywords (:key) (:test :test-not) |
790 |
The result list contains all items that appear in both LIST1 and LIST2. |
The result list contains all items that appear in both LIST1 and LIST2. |
791 |
This is a destructive function; it reuses the storage of LIST1 and LIST2 |
This is a destructive function; it reuses the storage of LIST1 and LIST2 |
792 |
whenever possible. |
whenever possible. |
793 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
794 |
|
\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" |
795 |
(and cl-list1 cl-list2 (apply 'intersection cl-list1 cl-list2 cl-keys))) |
(and cl-list1 cl-list2 (apply 'intersection cl-list1 cl-list2 cl-keys))) |
796 |
|
|
797 |
(defun set-difference (cl-list1 cl-list2 &rest cl-keys) |
(defun set-difference (cl-list1 cl-list2 &rest cl-keys) |
799 |
The result list contains all items that appear in LIST1 but not LIST2. |
The result list contains all items that appear in LIST1 but not LIST2. |
800 |
This is a non-destructive function; it makes a copy of the data if necessary |
This is a non-destructive function; it makes a copy of the data if necessary |
801 |
to avoid corrupting the original LIST1 and LIST2. |
to avoid corrupting the original LIST1 and LIST2. |
802 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
803 |
|
\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" |
804 |
(if (or (null cl-list1) (null cl-list2)) cl-list1 |
(if (or (null cl-list1) (null cl-list2)) cl-list1 |
805 |
(cl-parsing-keywords (:key) (:test :test-not) |
(cl-parsing-keywords (:key) (:test :test-not) |
806 |
(let ((cl-res nil)) |
(let ((cl-res nil)) |
818 |
The result list contains all items that appear in LIST1 but not LIST2. |
The result list contains all items that appear in LIST1 but not LIST2. |
819 |
This is a destructive function; it reuses the storage of LIST1 and LIST2 |
This is a destructive function; it reuses the storage of LIST1 and LIST2 |
820 |
whenever possible. |
whenever possible. |
821 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
822 |
|
\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" |
823 |
(if (or (null cl-list1) (null cl-list2)) cl-list1 |
(if (or (null cl-list1) (null cl-list2)) cl-list1 |
824 |
(apply 'set-difference cl-list1 cl-list2 cl-keys))) |
(apply 'set-difference cl-list1 cl-list2 cl-keys))) |
825 |
|
|
828 |
The result list contains all items that appear in exactly one of LIST1, LIST2. |
The result list contains all items that appear in exactly one of LIST1, LIST2. |
829 |
This is a non-destructive function; it makes a copy of the data if necessary |
This is a non-destructive function; it makes a copy of the data if necessary |
830 |
to avoid corrupting the original LIST1 and LIST2. |
to avoid corrupting the original LIST1 and LIST2. |
831 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
832 |
|
\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" |
833 |
(cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1) |
(cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1) |
834 |
((equal cl-list1 cl-list2) nil) |
((equal cl-list1 cl-list2) nil) |
835 |
(t (append (apply 'set-difference cl-list1 cl-list2 cl-keys) |
(t (append (apply 'set-difference cl-list1 cl-list2 cl-keys) |
840 |
The result list contains all items that appear in exactly one of LIST1, LIST2. |
The result list contains all items that appear in exactly one of LIST1, LIST2. |
841 |
This is a destructive function; it reuses the storage of LIST1 and LIST2 |
This is a destructive function; it reuses the storage of LIST1 and LIST2 |
842 |
whenever possible. |
whenever possible. |
843 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
844 |
|
\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" |
845 |
(cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1) |
(cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1) |
846 |
((equal cl-list1 cl-list2) nil) |
((equal cl-list1 cl-list2) nil) |
847 |
(t (nconc (apply 'nset-difference cl-list1 cl-list2 cl-keys) |
(t (nconc (apply 'nset-difference cl-list1 cl-list2 cl-keys) |
850 |
(defun subsetp (cl-list1 cl-list2 &rest cl-keys) |
(defun subsetp (cl-list1 cl-list2 &rest cl-keys) |
851 |
"Return true if LIST1 is a subset of LIST2. |
"Return true if LIST1 is a subset of LIST2. |
852 |
I.e., if every element of LIST1 also appears in LIST2. |
I.e., if every element of LIST1 also appears in LIST2. |
853 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
854 |
|
\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" |
855 |
(cond ((null cl-list1) t) ((null cl-list2) nil) |
(cond ((null cl-list1) t) ((null cl-list2) nil) |
856 |
((equal cl-list1 cl-list2) t) |
((equal cl-list1 cl-list2) t) |
857 |
(t (cl-parsing-keywords (:key) (:test :test-not) |
(t (cl-parsing-keywords (:key) (:test :test-not) |
864 |
(defun subst-if (cl-new cl-pred cl-tree &rest cl-keys) |
(defun subst-if (cl-new cl-pred cl-tree &rest cl-keys) |
865 |
"Substitute NEW for elements matching PREDICATE in TREE (non-destructively). |
"Substitute NEW for elements matching PREDICATE in TREE (non-destructively). |
866 |
Return a copy of TREE with all matching elements replaced by NEW. |
Return a copy of TREE with all matching elements replaced by NEW. |
867 |
Keywords supported: :key" |
\nKeywords supported: :key |
868 |
|
\n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" |
869 |
(apply 'sublis (list (cons nil cl-new)) cl-tree :if cl-pred cl-keys)) |
(apply 'sublis (list (cons nil cl-new)) cl-tree :if cl-pred cl-keys)) |
870 |
|
|
871 |
(defun subst-if-not (cl-new cl-pred cl-tree &rest cl-keys) |
(defun subst-if-not (cl-new cl-pred cl-tree &rest cl-keys) |
872 |
"Substitute NEW for elts not matching PREDICATE in TREE (non-destructively). |
"Substitute NEW for elts not matching PREDICATE in TREE (non-destructively). |
873 |
Return a copy of TREE with all non-matching elements replaced by NEW. |
Return a copy of TREE with all non-matching elements replaced by NEW. |
874 |
Keywords supported: :key" |
\nKeywords supported: :key |
875 |
|
\n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" |
876 |
(apply 'sublis (list (cons nil cl-new)) cl-tree :if-not cl-pred cl-keys)) |
(apply 'sublis (list (cons nil cl-new)) cl-tree :if-not cl-pred cl-keys)) |
877 |
|
|
878 |
(defun nsubst (cl-new cl-old cl-tree &rest cl-keys) |
(defun nsubst (cl-new cl-old cl-tree &rest cl-keys) |
879 |
"Substitute NEW for OLD everywhere in TREE (destructively). |
"Substitute NEW for OLD everywhere in TREE (destructively). |
880 |
Any element of TREE which is `eql' to OLD is changed to NEW (via a call |
Any element of TREE which is `eql' to OLD is changed to NEW (via a call |
881 |
to `setcar'). |
to `setcar'). |
882 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
883 |
|
\n(fn NEW OLD TREE [KEYWORD VALUE]...)" |
884 |
(apply 'nsublis (list (cons cl-old cl-new)) cl-tree cl-keys)) |
(apply 'nsublis (list (cons cl-old cl-new)) cl-tree cl-keys)) |
885 |
|
|
886 |
(defun nsubst-if (cl-new cl-pred cl-tree &rest cl-keys) |
(defun nsubst-if (cl-new cl-pred cl-tree &rest cl-keys) |
887 |
"Substitute NEW for elements matching PREDICATE in TREE (destructively). |
"Substitute NEW for elements matching PREDICATE in TREE (destructively). |
888 |
Any element of TREE which matches is changed to NEW (via a call to `setcar'). |
Any element of TREE which matches is changed to NEW (via a call to `setcar'). |
889 |
Keywords supported: :key" |
\nKeywords supported: :key |
890 |
|
\n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" |
891 |
(apply 'nsublis (list (cons nil cl-new)) cl-tree :if cl-pred cl-keys)) |
(apply 'nsublis (list (cons nil cl-new)) cl-tree :if cl-pred cl-keys)) |
892 |
|
|
893 |
(defun nsubst-if-not (cl-new cl-pred cl-tree &rest cl-keys) |
(defun nsubst-if-not (cl-new cl-pred cl-tree &rest cl-keys) |
894 |
"Substitute NEW for elements not matching PREDICATE in TREE (destructively). |
"Substitute NEW for elements not matching PREDICATE in TREE (destructively). |
895 |
Any element of TREE which matches is changed to NEW (via a call to `setcar'). |
Any element of TREE which matches is changed to NEW (via a call to `setcar'). |
896 |
Keywords supported: :key" |
\nKeywords supported: :key |
897 |
|
\n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" |
898 |
(apply 'nsublis (list (cons nil cl-new)) cl-tree :if-not cl-pred cl-keys)) |
(apply 'nsublis (list (cons nil cl-new)) cl-tree :if-not cl-pred cl-keys)) |
899 |
|
|
900 |
(defun sublis (cl-alist cl-tree &rest cl-keys) |
(defun sublis (cl-alist cl-tree &rest cl-keys) |
901 |
"Perform substitutions indicated by ALIST in TREE (non-destructively). |
"Perform substitutions indicated by ALIST in TREE (non-destructively). |
902 |
Return a copy of TREE with all matching elements replaced. |
Return a copy of TREE with all matching elements replaced. |
903 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
904 |
|
\n(fn ALIST TREE [KEYWORD VALUE]...)" |
905 |
(cl-parsing-keywords (:test :test-not :key :if :if-not) () |
(cl-parsing-keywords (:test :test-not :key :if :if-not) () |
906 |
(cl-sublis-rec cl-tree))) |
(cl-sublis-rec cl-tree))) |
907 |
|
|
922 |
(defun nsublis (cl-alist cl-tree &rest cl-keys) |
(defun nsublis (cl-alist cl-tree &rest cl-keys) |
923 |
"Perform substitutions indicated by ALIST in TREE (destructively). |
"Perform substitutions indicated by ALIST in TREE (destructively). |
924 |
Any matching element of TREE is changed via a call to `setcar'. |
Any matching element of TREE is changed via a call to `setcar'. |
925 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
926 |
|
\n(fn ALIST TREE [KEYWORD VALUE]...)" |
927 |
(cl-parsing-keywords (:test :test-not :key :if :if-not) () |
(cl-parsing-keywords (:test :test-not :key :if :if-not) () |
928 |
(let ((cl-hold (list cl-tree))) |
(let ((cl-hold (list cl-tree))) |
929 |
(cl-nsublis-rec cl-hold) |
(cl-nsublis-rec cl-hold) |
944 |
(setq cl-tree (cdr cl-tree)))))) |
(setq cl-tree (cdr cl-tree)))))) |
945 |
|
|
946 |
(defun tree-equal (cl-x cl-y &rest cl-keys) |
(defun tree-equal (cl-x cl-y &rest cl-keys) |
947 |
"Return t if trees X and Y have `eql' leaves. |
"Return t if trees TREE1 and TREE2 have `eql' leaves. |
948 |
Atoms are compared by `eql'; cons cells are compared recursively. |
Atoms are compared by `eql'; cons cells are compared recursively. |
949 |
Keywords supported: :test :test-not :key" |
\nKeywords supported: :test :test-not :key |
950 |
|
\n(fn TREE1 TREE2 [KEYWORD VALUE]...)" |
951 |
(cl-parsing-keywords (:test :test-not :key) () |
(cl-parsing-keywords (:test :test-not :key) () |
952 |
(cl-tree-equal-rec cl-x cl-y))) |
(cl-tree-equal-rec cl-x cl-y))) |
953 |
|
|