Coder Social home page Coder Social logo

list-utils's Introduction

Build Status

Overview

List-manipulation utility functions for Emacs.

Quickstart

(require 'list-utils)
 
(list-utils-flatten '(1 2 (3 4 (5 6 7))))
;; '(1 2 3 4 5 6 7)
 
(list-utils-depth '(1 2 (3 4 (5 6 7))))
;; 3
 
(let ((cyclic-list '(1 2 3 4 5 6 7)))
  (nconc cyclic-list (cdr cyclic-list))
  (list-utils-make-linear-inplace cyclic-list))
;; '(1 2 3 4 5 6 7)
 
(list-utils-cyclic-p '(1 2 3))
;; nil
 
(list-utils-plist-del '(:one 1 :two 2 :three 3) :two)
;; '(:one 1 :three 3)

Explanation

List-utils is a collection of functions for list manipulation. This library has no user-level interface; it is only useful for programming in Emacs Lisp.

Notable functionality includes

  • list-utils-flatten, a robust list-flattener which handles cyclic lists, non-nil-terminated lists, and preserves nils when they are found as list elements.

  • tconc, a simple data structure for efficiently appending to a list

The following functions are provided:

make-tconc
tconc-p
tconc-list
tconc
list-utils-cons-cell-p
list-utils-cyclic-length
list-utils-improper-p
list-utils-make-proper-copy
list-utils-make-proper-inplace
list-utils-make-improper-copy
list-utils-make-improper-inplace
list-utils-linear-p
list-utils-linear-subseq
list-utils-cyclic-p
list-utils-cyclic-subseq
list-utils-make-linear-copy
list-utils-make-linear-inplace
list-utils-safe-length
list-utils-safe-equal
list-utils-depth
list-utils-flat-length
list-utils-flatten
list-utils-alist-or-flat-length
list-utils-alist-flatten
list-utils-insert-before
list-utils-insert-after
list-utils-insert-before-pos
list-utils-insert-after-pos
list-utils-and
list-utils-not
list-utils-xor
list-utils-uniq
list-utils-dupes
list-utils-singlets
list-utils-partition-dupes
list-utils-plist-reverse
list-utils-plist-del

To use list-utils, place the list-utils.el library somewhere Emacs can find it, and add the following to your ~/.emacs file:

(require 'list-utils)

Notes

This library includes an implementation of the classic Lisp tconc which is outside the list-utils- namespace.

Compatibility and Requirements

No external dependencies

list-utils's People

Contributors

hlissner avatar rassie avatar rolandwalker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

list-utils's Issues

Dependent on cl

LIne 259 has (require 'cl) and package cl was deprecated in Emacs 27. Would be lovely if this dependency could be removed.

test failures with 25.1 RC1 (macOS)

I tried running make test-batch on macOS 10.11.6 with the first 25.1 release candidate and got the following failures: https://gist.github.com/dunn/0bc466e363fbaac07856a387c5b4ab12

Here's the tail end of the logs:

   passed   88/311  list-utils-insert-after-03
Debugger entered: ((cl-assertion-failed pos "Element not found: %s"))
  cl--assertion-failed(pos "Element not found: %s" nil (6))
  (or pos (cl--assertion-failed (quote pos) "Element not found: %s" (list) (list element)))
  (progn (or pos (cl--assertion-failed (quote pos) "Element not found: %s" (list) (list element))) nil)
  (let ((improper (list-utils-improper-p list)) (pos nil)) (if improper (progn (setq list (list-utils-make-proper-inplace list)))) (setq pos (position element list :test test)) (progn (or pos (cl--assertion-failed (quote pos) "Element not found: %s" (list) (list element))) nil) (let* ((v (nthcdr pos list))) (setcdr v (cons new-element (cdr v)))) (if improper (progn (setq list (list-utils-make-improper-inplace list)))))
  list-utils-insert-after((1 2 3 4 5) 6 elt)
  apply(list-utils-insert-after ((1 2 3 4 5) 6 elt))
  (setq value-1393 (apply fn-1391 args-1392))
  (unwind-protect (setq value-1393 (apply fn-1391 args-1392)) (setq form-description-1395 (nconc (list (quote (should-error (list-utils-insert-after (quote ...) 6 (quote elt))))) (list :form (cons fn-1391 args-1392)) (if (eql value-1393 (quote ert-form-evaluation-aborted-1394)) nil (list :value value-1393)) (let ((-explainer- (and (symbolp ...) (get ... ...)))) (if -explainer- (progn (list :explanation (apply -explainer- args-1392))))))) (ert--signal-should-execution form-description-1395))
  (condition-case -condition- (unwind-protect (setq value-1393 (apply fn-1391 args-1392)) (setq form-description-1395 (nconc (list (quote (should-error (list-utils-insert-after ... 6 ...)))) (list :form (cons fn-1391 args-1392)) (if (eql value-1393 (quote ert-form-evaluation-aborted-1394)) nil (list :value value-1393)) (let ((-explainer- (and ... ...))) (if -explainer- (progn (list :explanation ...)))))) (ert--signal-should-execution form-description-1395)) (error (setq errorp1396 t) (ert--should-error-handle-error form-description-fn-1397 -condition- (quote error) nil) (setq value-1393 -condition-)))
  (let ((errorp1396 nil) (form-description-fn-1397 (function (lambda nil form-description-1395)))) (condition-case -condition- (unwind-protect (setq value-1393 (apply fn-1391 args-1392)) (setq form-description-1395 (nconc (list (quote (should-error ...))) (list :form (cons fn-1391 args-1392)) (if (eql value-1393 (quote ert-form-evaluation-aborted-1394)) nil (list :value value-1393)) (let ((-explainer- ...)) (if -explainer- (progn ...))))) (ert--signal-should-execution form-description-1395)) (error (setq errorp1396 t) (ert--should-error-handle-error form-description-fn-1397 -condition- (quote error) nil) (setq value-1393 -condition-))) (if errorp1396 nil (ert-fail (append (funcall form-description-fn-1397) (list :fail-reason "did not signal an error")))))
  (let (form-description-1395) (let ((errorp1396 nil) (form-description-fn-1397 (function (lambda nil form-description-1395)))) (condition-case -condition- (unwind-protect (setq value-1393 (apply fn-1391 args-1392)) (setq form-description-1395 (nconc (list (quote ...)) (list :form (cons fn-1391 args-1392)) (if (eql value-1393 ...) nil (list :value value-1393)) (let (...) (if -explainer- ...)))) (ert--signal-should-execution form-description-1395)) (error (setq errorp1396 t) (ert--should-error-handle-error form-description-fn-1397 -condition- (quote error) nil) (setq value-1393 -condition-))) (if errorp1396 nil (ert-fail (append (funcall form-description-fn-1397) (list :fail-reason "did not signal an error"))))))
  (let ((value-1393 (quote ert-form-evaluation-aborted-1394))) (let (form-description-1395) (let ((errorp1396 nil) (form-description-fn-1397 (function (lambda nil form-description-1395)))) (condition-case -condition- (unwind-protect (setq value-1393 (apply fn-1391 args-1392)) (setq form-description-1395 (nconc (list ...) (list :form ...) (if ... nil ...) (let ... ...))) (ert--signal-should-execution form-description-1395)) (error (setq errorp1396 t) (ert--should-error-handle-error form-description-fn-1397 -condition- (quote error) nil) (setq value-1393 -condition-))) (if errorp1396 nil (ert-fail (append (funcall form-description-fn-1397) (list :fail-reason "did not signal an error")))))) value-1393)
  (let ((fn-1391 (function list-utils-insert-after)) (args-1392 (list (quote (1 2 3 4 5)) 6 (quote elt)))) (let ((value-1393 (quote ert-form-evaluation-aborted-1394))) (let (form-description-1395) (let ((errorp1396 nil) (form-description-fn-1397 (function (lambda nil form-description-1395)))) (condition-case -condition- (unwind-protect (setq value-1393 (apply fn-1391 args-1392)) (setq form-description-1395 (nconc ... ... ... ...)) (ert--signal-should-execution form-description-1395)) (error (setq errorp1396 t) (ert--should-error-handle-error form-description-fn-1397 -condition- (quote error) nil) (setq value-1393 -condition-))) (if errorp1396 nil (ert-fail (append (funcall form-description-fn-1397) (list :fail-reason "did not signal an error")))))) value-1393))
  (lambda nil (let ((fn-1391 (function list-utils-insert-after)) (args-1392 (list (quote (1 2 3 4 5)) 6 (quote elt)))) (let ((value-1393 (quote ert-form-evaluation-aborted-1394))) (let (form-description-1395) (let ((errorp1396 nil) (form-description-fn-1397 (function ...))) (condition-case -condition- (unwind-protect (setq value-1393 ...) (setq form-description-1395 ...) (ert--signal-should-execution form-description-1395)) (error (setq errorp1396 t) (ert--should-error-handle-error form-description-fn-1397 -condition- ... nil) (setq value-1393 -condition-))) (if errorp1396 nil (ert-fail (append ... ...))))) value-1393)))()
  ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struct-ert-test list-utils-insert-after-04 nil (lambda nil (let ((fn-1391 (function list-utils-insert-after)) (args-1392 (list (quote ...) 6 (quote elt)))) (let ((value-1393 (quote ert-form-evaluation-aborted-1394))) (let (form-description-1395) (let (... ...) (condition-case -condition- ... ...) (if errorp1396 nil ...))) value-1393))) nil :passed nil] [cl-struct-ert-test-aborted-with-non-local-exit nil nil] #[0 "\300\301\302\"\207" [throw --cl-block-error-- nil] 3] debug nil])
  ert-run-test([cl-struct-ert-test list-utils-insert-after-04 nil (lambda nil (let ((fn-1391 (function list-utils-insert-after)) (args-1392 (list (quote (1 2 3 4 5)) 6 (quote elt)))) (let ((value-1393 (quote ert-form-evaluation-aborted-1394))) (let (form-description-1395) (let ((errorp1396 nil) (form-description-fn-1397 ...)) (condition-case -condition- (unwind-protect ... ... ...) (error ... ... ...)) (if errorp1396 nil (ert-fail ...)))) value-1393))) nil :passed nil])
  ert-run-or-rerun-test([cl-struct-ert--stats (and "" (not (tag :interactive))) [[cl-struct-ert-test list-utils-alist-flatten-01 nil (lambda nil (let ((fn-1282 (function equal)) (args-1283 (list ... ...))) (let ((value-1284 ...)) (let (form-description-1286) (if ... nil ...)) value-1284))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (1 2 3 4 . 5) (1 2 3 4 . 5)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-alist-flatten-02 nil (lambda nil (let ((fn-1287 (function equal)) (args-1288 (list ... ...))) (let ((value-1289 ...)) (let (form-description-1291) (if ... nil ...)) value-1289))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (1 2 3 ...) (1 2 3 ...)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-alist-flatten-03 nil (lambda nil (let ((fn-1292 (function equal)) (args-1293 (list ... ...))) (let ((value-1294 ...)) (let (form-description-1296) (if ... nil ...)) value-1294))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (1 2 3 ...) (1 2 3 ...)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-alist-flatten-04 nil (lambda nil (let ((fn-1297 (function equal)) (args-1298 (list ... ...))) (let ((value-1299 ...)) (let (form-description-1301) (if ... nil ...)) value-1299))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (... ... ... ...) (... ... ... ...)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-alist-flatten-05 nil (lambda nil (let ((fn-1302 (function equal)) (args-1303 (list ... ...))) (let ((value-1304 ...)) (let (form-description-1306) (if ... nil ...)) value-1304))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (1 . 2) (1 . 2)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-alist-flatten-06 "Don't modifiy LIST" (lambda nil (let ((cyclic-1 (quote ...)) (cyclic-2 (quote ...))) (nconc cyclic-1 (cdr cyclic-1)) (nconc cyclic-2 (cdr cyclic-2)) (let ((fn-1307 ...) (args-1308 ...)) (let (...) (let ... ...) value-1309)) (let ((fn-1312 ...) (args-1313 ...)) (let (...) (let ... ...) value-1314)) (let ((fn-1317 ...) (args-1318 ...)) (let (...) (let ... ...) value-1319)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (1 2 3 ... ...) (1 2 3 ... ...)) :value t :explanation nil) ((should (equal ... ...)) :form (equal (1) (1)) :value t :explanation nil) ((should (equal ... ...)) :form (equal (... 2 3) (... 2 3)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-alist-or-flat-length-01 nil (lambda nil (let ((mixed (quote ...))) (let ((fn-1277 ...) (args-1278 ...)) (let (...) (let ... ...) value-1279)))) [cl-struct-ert-test-passed "" (((should (= 11 ...)) :form (= 11 11) :value t))] :passed nil] [cl-struct-ert-test list-utils-and-01 "Logical AND operation on two lists" (lambda nil (let ((list-1 (quote ...)) (list-2 (quote ...))) (let ((fn-1542 ...) (args-1543 ...)) (let (...) (let ... ...) value-1544)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (a a 1 2 3 3 3) (a a 1 2 3 3 3)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-and-02 "Logical AND operation with size hint, should be identical" (lambda nil (let ((list-1 (quote ...)) (list-2 (quote ...))) (let ((fn-1547 ...) (args-1548 ...)) (let (...) (let ... ...) value-1549)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (a a 1 2 3 3 3) (a a 1 2 3 3 3)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-and-03 "Logical AND operation with FLIP param" (lambda nil (let ((list-1 (quote ...)) (list-2 (quote ...))) (let ((fn-1552 ...) (args-1553 ...)) (let (...) (let ... ...) value-1554)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (a 1 2 3) (a 1 2 3)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-and-04 "Logical AND operation with FLIP param should be the same as reversing order of list args" (lambda nil (let ((list-1 (quote ...)) (list-2 (quote ...))) (let ((fn-1557 ...) (args-1558 ...)) (let (...) (let ... ...) value-1559)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (a 1 2 3) (a 1 2 3)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-and-05 "Logical AND operation with numeric hash-table-test" (lambda nil (let ((list-1 (quote ...)) (list-2 (quote ...))) (let ((fn-1562 ...) (args-1563 ...)) (let (...) (let ... ...) value-1564)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (a a 1 2 3 3 3 4.0) (a a 1 2 3 3 3 4.0)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-and-06 "Logical AND operation with numeric hash-table-test and FLIP param" (lambda nil (let ((list-1 (quote ...)) (list-2 (quote ...))) (let ((fn-1567 ...) (args-1568 ...)) (let (...) (let ... ...) value-1569)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (a 1 2 3 4) (a 1 2 3 4)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-and-07 "Logical AND operation with case-insensitive hash-table-test" (lambda nil (let ((list-1 (quote ...)) (list-2 (quote ...))) (let ((fn-1572 ...) (args-1573 ...)) (let (...) (let ... ...) value-1574)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (A a a 1 2 3 3 3) (A a a 1 2 3 3 3)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-and-08 "Logical AND operation with case-insensitive hash-table-test and FLIP param" (lambda nil (let ((list-1 (quote ...)) (list-2 (quote ...))) (let ((fn-1577 ...) (args-1578 ...)) (let (...) (let ... ...) value-1579)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (a 1 2 3) (a 1 2 3)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-and-09 "Logical AND operation should be identical to `cl-intersection' after sort/uniq" (lambda nil (let ((list-1 (quote ...)) (list-2 (quote ...))) (let ((fn-1582 ...) (args-1583 ...)) (let (...) (let ... ...) value-1584)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (1 2 3 a) (1 2 3 a)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-and-10 "Logical AND operation with two large lists" (lambda nil (let ((list-1 (number-sequence 1 10000)) (list-2 (reverse ...))) (let ((fn-1587 ...) (args-1588 ...)) (let (...) (let ... ...) value-1589)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 ...) (4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 ...)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-and-11 "Logical AND operation with large lists and size hint, should be identical" (lambda nil (let ((list-1 (number-sequence 1 10000)) (list-2 (reverse ...))) (let ((fn-1592 ...) (args-1593 ...)) (let (...) (let ... ...) value-1594)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 ...) (4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 ...)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-and-12 "Logical AND operation with large lists and FLIP param" (lambda nil (let ((list-1 (number-sequence 1 10000)) (list-2 (reverse ...))) (let ((fn-1597 ...) (args-1598 ...)) (let (...) (let ... ...) value-1599)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (10000 9999 9998 9997 9996 9995 9994 9993 9992 9991 9990 9989 9988 9987 9986 9985 9984 9983 9982 9981 9980 9979 9978 9977 9976 9975 9974 9973 9972 9971 9970 9969 9968 9967 9966 9965 9964 9963 9962 9961 9960 9959 9958 9957 9956 9955 9954 9953 9952 9951 ...) (10000 9999 9998 9997 9996 9995 9994 9993 9992 9991 9990 9989 9988 9987 9986 9985 9984 9983 9982 9981 9980 9979 9978 9977 9976 9975 9974 9973 9972 9971 9970 9969 9968 9967 9966 9965 9964 9963 9962 9961 9960 9959 9958 9957 9956 9955 9954 9953 9952 9951 ...)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-and-13 "Logical AND operation with large lists and FLIP param should be the same as reversing order of list args" (lambda nil (let ((list-1 (number-sequence 1 10000)) (list-2 (reverse ...))) (let ((fn-1602 ...) (args-1603 ...)) (let (...) (let ... ...) value-1604)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (10000 9999 9998 9997 9996 9995 9994 9993 9992 9991 9990 9989 9988 9987 9986 9985 9984 9983 9982 9981 9980 9979 9978 9977 9976 9975 9974 9973 9972 9971 9970 9969 9968 9967 9966 9965 9964 9963 9962 9961 9960 9959 9958 9957 9956 9955 9954 9953 9952 9951 ...) (10000 9999 9998 9997 9996 9995 9994 9993 9992 9991 9990 9989 9988 9987 9986 9985 9984 9983 9982 9981 9980 9979 9978 9977 9976 9975 9974 9973 9972 9971 9970 9969 9968 9967 9966 9965 9964 9963 9962 9961 9960 9959 9958 9957 9956 9955 9954 9953 9952 9951 ...)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-and-14 "Logical AND operation with large lists and numeric hash-table-test" (lambda nil (let ((list-1 (number-sequence 1 10000)) (list-2 (reverse ...))) (let ((fn-1607 ...) (args-1608 ...)) (let (...) (let ... ...) value-1609)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 ...) (4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 ...)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-and-15 "Logical AND operation with large lists and case-insensitive hash-table-test" (lambda nil (let ((list-1 (mapcar ... ...)) (list-2 (mapcar ... ...))) (let ((fn-1612 ...) (args-1613 ...)) (let (...) (let ... ...) value-1614)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal ("�" "�" "�" "�" "�" "    " "\n" "�" "\f" "
" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" " " "!" "\"" "#" "$" "%" "&" "'" "(" ")" "*" "+" "," "-" "." "/" "0" "1" "2" "3" "4" "5" ...) ("�" "�" "�" "�" "�" "  " "\n" "�" "\f" "
" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" " " "!" "\"" "#" "$" "%" "&" "'" "(" ")" "*" "+" "," "-" "." "/" "0" "1" "2" "3" "4" "5" ...)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-and-16 "Logical AND operation with large lists should be identical to `cl-intersection' after sort/uniq" (lambda nil (let ((list-1 (number-sequence 1 10000)) (list-2 (reverse ...))) (let ((fn-1617 ...) (args-1618 ...)) (let (...) (let ... ...) value-1619)))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (10 100 1000 10000 1001 1002 1003 1004 1005 1006 1007 1008 1009 101 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 102 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 103 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 104 1040 1041 1042 ...) (10 100 1000 10000 1001 1002 1003 1004 1005 1006 1007 1008 1009 101 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 102 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 103 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 104 1040 1041 1042 ...)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-cons-cell-p-01 nil (lambda nil (let ((fn-30 (function list-utils-cons-cell-p)) (args-31 (list ...))) (let ((value-32 ...)) (let (form-description-34) (if ... nil ...)) value-32))) [cl-struct-ert-test-passed "" (((should-not (list-utils-cons-cell-p ...)) :form (list-utils-cons-cell-p (a b c d e f)) :value nil))] :passed nil] [cl-struct-ert-test list-utils-cons-cell-p-02 nil (lambda nil (let ((fn-35 (function list-utils-cons-cell-p)) (args-36 (list nil))) (let ((value-37 ...)) (let (form-description-39) (if ... nil ...)) value-37))) [cl-struct-ert-test-passed "" (((should-not (list-utils-cons-cell-p nil)) :form (list-utils-cons-cell-p nil) :value nil))] :passed nil] [cl-struct-ert-test list-utils-cons-cell-p-03 nil (lambda nil (let ((fn-40 (function list-utils-cons-cell-p)) (args-41 (list 1))) (let ((value-42 ...)) (let (form-description-44) (if ... nil ...)) value-42))) [cl-struct-ert-test-passed "" (((should-not (list-utils-cons-cell-p 1)) :form (list-utils-cons-cell-p 1) :value nil))] :passed nil] [cl-struct-ert-test list-utils-cons-cell-p-04 nil (lambda nil (let ((fn-45 (function =)) (args-46 (list 2 ...))) (let ((value-47 ...)) (let (form-description-49) (if ... nil ...)) value-47))) [cl-struct-ert-test-passed "" (((should (= 2 ...)) :form (= 2 2) :value t))] :passed nil] [cl-struct-ert-test list-utils-cons-cell-p-05 nil (lambda nil (let ((fn-50 (function =)) (args-51 (list 6 ...))) (let ((value-52 ...)) (let (form-description-54) (if ... nil ...)) value-52))) [cl-struct-ert-test-passed "" (((should (= 6 ...)) :form (= 6 6) :value t))] :passed nil] [cl-struct-ert-test list-utils-cyclic-length-01 nil (lambda nil (let ((fn-687 (function =)) (args-688 (list 8 ...))) (let ((value-689 ...)) (let (form-description-691) (if ... nil ...)) value-689))) [cl-struct-ert-test-passed "" (((should (= 8 ...)) :form (= 8 8) :value t))] :passed nil] [cl-struct-ert-test list-utils-cyclic-length-02 nil (lambda nil (let ((fn-692 (function =)) (args-693 (list 7 ...))) (let ((value-694 ...)) (let (form-description-696) (if ... nil ...)) value-694))) [cl-struct-ert-test-passed "" (((should (= 7 ...)) :form (= 7 7) :value t))] :passed nil] [cl-struct-ert-test list-utils-cyclic-length-03 nil (lambda nil (let ((fn-697 (function =)) (args-698 (list 1 ...))) (let ((value-699 ...)) (let (form-description-701) (if ... nil ...)) value-699))) [cl-struct-ert-test-passed "" (((should (= 1 ...)) :form (= 1 1) :value t))] :passed nil] [cl-struct-ert-test list-utils-cyclic-length-04 nil (lambda nil (let ((fn-702 (function =)) (args-703 (list 0 ...))) (let ((value-704 ...)) (let (form-description-706) (if ... nil ...)) value-704))) [cl-struct-ert-test-passed "" (((should (= 0 ...)) :form (= 0 0) :value t))] :passed nil] [cl-struct-ert-test list-utils-cyclic-length-05 nil (lambda nil (let ((fn-707 (function =)) (args-708 (list 0 ...))) (let ((value-709 ...)) (let (form-description-711) (if ... nil ...)) value-709))) [cl-struct-ert-test-passed "" (((should (= 0 ...)) :form (= 0 0) :value t))] :passed nil] [cl-struct-ert-test list-utils-cyclic-length-06 nil (lambda nil (let ((cyclic (quote ...))) (nconc cyclic cyclic) (let ((fn-712 ...) (args-713 ...)) (let (...) (let ... ...) value-714)))) [cl-struct-ert-test-passed "" (((should (= 1 ...)) :form (= 1 1) :value t))] :passed nil] [cl-struct-ert-test list-utils-cyclic-p-01 nil (lambda nil (let ((value-762 (cl-gensym "ert-form-evaluation-aborted-"))) (let (form-description-763) (if (unwind-protect ... ... ...) nil (ert-fail form-description-763))) value-762)) [cl-struct-ert-test-passed "" (((should (let ... ... ...)) :form (let (...) (nconc cyclic cyclic) (list-utils-cyclic-p cyclic)) :value (1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 . #7)))] :passed nil] [cl-struct-ert-test list-utils-cyclic-p-02 nil (lambda nil (let ((value-764 (cl-gensym "ert-form-evaluation-aborted-"))) (let (form-description-765) (if (unwind-protect ... ... ...) nil (ert-fail form-description-765))) value-764)) [cl-struct-ert-test-passed "" (((should (let ... ... ...)) :form (let (...) (nconc cyclic cyclic) (list-utils-cyclic-p cyclic ...)) :value (1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 . #7)))] :passed nil] [cl-struct-ert-test list-utils-cyclic-p-03 nil (lambda nil (let ((value-766 (cl-gensym "ert-form-evaluation-aborted-"))) (let (form-description-767) (if (unwind-protect ... ... ...) nil (ert-fail form-description-767))) value-766)) [cl-struct-ert-test-passed "" (((should (let ... ... ...)) :form (let (...) (nconc cyclic ...) (list-utils-cyclic-p cyclic)) :value (8 2 3 4 5 6 7 8 2 3 4 5 6 . #6)))] :passed nil] [cl-struct-ert-test list-utils-cyclic-p-04 nil (lambda nil (let ((value-768 (cl-gensym "ert-form-evaluation-aborted-"))) (let (form-description-769) (if (not ...) nil (ert-fail form-description-769))) value-768)) [cl-struct-ert-test-passed "" (((should-not (let ... ... ...)) :form (let (...) (nconc cyclic ...) (list-utils-cyclic-p cyclic ...)) :value nil))] :passed nil] [cl-struct-ert-test list-utils-cyclic-p-05 nil (lambda nil (let ((value-770 (cl-gensym "ert-form-evaluation-aborted-"))) (let (form-description-771) (if (unwind-protect ... ... ...) nil (ert-fail form-description-771))) value-770)) [cl-struct-ert-test-passed "" (((should (let ... ... ...)) :form (let (...) (nconc cyclic ...) (list-utils-cyclic-p cyclic)) :value (8 . #0)))] :passed nil] [cl-struct-ert-test list-utils-cyclic-p-06 nil (lambda nil (let ((fn-772 (function list-utils-cyclic-p)) (args-773 (list ...))) (let ((value-774 ...)) (let (form-description-776) (if ... nil ...)) value-774))) [cl-struct-ert-test-passed "" (((should-not (list-utils-cyclic-p ...)) :form (list-utils-cyclic-p (1 2 3)) :value nil))] :passed nil] [cl-struct-ert-test list-utils-cyclic-p-07 nil (lambda nil (let ((fn-777 (function list-utils-cyclic-p)) (args-778 (list nil))) (let ((value-779 ...)) (let (form-description-781) (if ... nil ...)) value-779))) [cl-struct-ert-test-passed "" (((should-not (list-utils-cyclic-p nil)) :form (list-utils-cyclic-p nil) :value nil))] :passed nil] [cl-struct-ert-test list-utils-cyclic-p-08 nil (lambda nil (let ((fn-782 (function list-utils-cyclic-p)) (args-783 (list ...))) (let ((value-784 ...)) (let (form-description-786) (if ... nil ...)) value-784))) [cl-struct-ert-test-passed "" (((should-not (list-utils-cyclic-p ...)) :form (list-utils-cyclic-p (1 . 2)) :value nil))] :passed nil] [cl-struct-ert-test list-utils-cyclic-p-09 nil (lambda nil (let ((fn-787 (function list-utils-cyclic-p)) (args-788 (list ...))) (let ((value-789 ...)) (let (form-description-791) (if ... nil ...)) value-789))) [cl-struct-ert-test-passed "" (((should-not (list-utils-cyclic-p ...)) :form (list-utils-cyclic-p (1 2 . 3)) :value nil))] :passed nil] [cl-struct-ert-test list-utils-cyclic-p-10 nil (lambda nil (let ((value-792 (cl-gensym "ert-form-evaluation-aborted-"))) (let (form-description-793) (if (unwind-protect ... ... ...) nil (ert-fail form-description-793))) value-792)) [cl-struct-ert-test-passed "" (((should (let ... ... ...)) :form (let (...) (nconc cyclic cyclic) (list-utils-cyclic-p cyclic)) :value (1 . #0)))] :passed nil] [cl-struct-ert-test list-utils-cyclic-subseq-01 nil (lambda nil (let ((fn-717 (function equal)) (args-718 (list ... ...))) (let ((value-719 ...)) (let (form-description-721) (if ... nil ...)) value-719))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (1 2 3 4 5 6 7 8) (1 2 3 4 5 6 7 8)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-cyclic-subseq-02 nil (lambda nil (let ((fn-722 (function equal)) (args-723 (list ... ...))) (let ((value-724 ...)) (let (form-description-726) (if ... nil ...)) value-724))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (2 3 4 5 6 7 8) (2 3 4 5 6 7 8)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-cyclic-subseq-03 nil (lambda nil (let ((fn-727 (function equal)) (args-728 (list ... ...))) (let ((value-729 ...)) (let (form-description-731) (if ... nil ...)) value-729))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (2 3 4 5 6 7 8) (2 3 4 5 6 7 8)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-cyclic-subseq-04 nil (lambda nil (let ((fn-732 (function equal)) (args-733 (list ... ...))) (let ((value-734 ...)) (let (form-description-736) (if ... nil ...)) value-734))) [cl-struct-ert-test-passed "" (((should (equal ... ...)) :form (equal (8) (8)) :value t :explanation nil))] :passed nil] [cl-struct-ert-test list-utils-cyclic-subseq-05 nil (lambda nil (let ((fn-737 (function list-utils-cyclic-subseq)) (args-738 (list ...))) (let ((value-739 ...)) (let (form-description-741) (if ... nil ...)) value-739))) [cl-struct-ert-test-passed "" (((should-not (list-utils-cyclic-subseq ...)) :form (list-utils-cyclic-subseq (1 2 3)) :value nil))] :passed nil] [cl-struct-ert-test list-utils-cyclic-subseq-06 nil (lambda nil (let ((fn-742 (function list-utils-cyclic-subseq)) (args-743 (list nil))) (let ((value-744 ...)) (let (form-description-746) (if ... nil ...)) value-744))) [cl-struct-ert-test-passed "" (((should-not (list-utils-cyclic-subseq nil)) :form (list-utils-cyclic-subseq nil) :value nil))] :passed nil] ...] #s(hash-table size 311 test eql rehash-size 1.5 rehash-threshold 0.8 data (list-utils-alist-flatten-01 0 list-utils-alist-flatten-02 1 list-utils-alist-flatten-03 2 list-utils-alist-flatten-04 3 list-utils-alist-flatten-05 4 list-utils-alist-flatten-06 5 list-utils-alist-or-flat-length-01 6 list-utils-and-01 7 list-utils-and-02 8 list-utils-and-03 9 list-utils-and-04 10 list-utils-and-05 11 list-utils-and-06 12 list-utils-and-07 13 list-utils-and-08 14 list-utils-and-09 15 list-utils-and-10 16 list-utils-and-11 17 list-utils-and-12 18 list-utils-and-13 19 list-utils-and-14 20 list-utils-and-15 21 list-utils-and-16 22 list-utils-cons-cell-p-01 23 list-utils-cons-cell-p-02 24 list-utils-cons-cell-p-03 25 list-utils-cons-cell-p-04 26 list-utils-cons-cell-p-05 27 list-utils-cyclic-length-01 28 list-utils-cyclic-length-02 29 list-utils-cyclic-length-03 30 list-utils-cyclic-length-04 31 list-utils-cyclic-length-05 32 list-utils-cyclic-length-06 33 list-utils-cyclic-p-01 34 list-utils-cyclic-p-02 35 list-utils-cyclic-p-03 36 list-utils-cyclic-p-04 37 list-utils-cyclic-p-05 38 list-utils-cyclic-p-06 39 list-utils-cyclic-p-07 40 list-utils-cyclic-p-08 41 list-utils-cyclic-p-09 42 list-utils-cyclic-p-10 43 list-utils-cyclic-subseq-01 44 list-utils-cyclic-subseq-02 45 list-utils-cyclic-subseq-03 46 list-utils-cyclic-subseq-04 47 list-utils-cyclic-subseq-05 48 list-utils-cyclic-subseq-06 49 ...)) [[cl-struct-ert-test-passed "" (((should (equal (quote ...) (list-utils-alist-flatten ...))) :form (equal (1 2 3 4 . 5) (1 2 3 4 . 5)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (quote ...) (list-utils-alist-flatten ...))) :form (equal (1 2 3 (4 . 5)) (1 2 3 (4 . 5))) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (quote ...) (list-utils-alist-flatten ...))) :form (equal (1 2 3 (4 . 5)) (1 2 3 (4 . 5))) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (quote ...) (list-utils-alist-flatten ...))) :form (equal ((1 . 2) (3 . 4) (5 . 6) (7 . 8)) ((1 . 2) (3 . 4) (5 . 6) (7 . 8))) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (cons 1 2) (list-utils-alist-flatten ...))) :form (equal (1 . 2) (1 . 2)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (quote ...) (list-utils-alist-flatten cyclic-1))) :form (equal (1 2 3 (4 . 5) (6 . 7)) (1 2 3 (4 . 5) (6 . 7))) :value t :explanation nil) ((should (equal (list-utils-linear-subseq cyclic-1) (list-utils-linear-subseq cyclic-2))) :form (equal (1) (1)) :value t :explanation nil) ((should (equal (subseq ... 0 ...) (subseq ... 0 ...))) :form (equal ((... ...) 2 3) ((... ...) 2 3)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (= 11 (list-utils-alist-or-flat-length mixed))) :form (= 11 11) :value t))] [cl-struct-ert-test-passed "" (((should (equal (quote ...) (list-utils-and list-1 list-2))) :form (equal (a a 1 2 3 3 3) (a a 1 2 3 3 3)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (list-utils-and list-1 list-2) (list-utils-and list-1 list-2 nil 17))) :form (equal (a a 1 2 3 3 3) (a a 1 2 3 3 3)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (quote ...) (list-utils-and list-1 list-2 nil nil ...))) :form (equal (a 1 2 3) (a 1 2 3)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (list-utils-and list-2 list-1) (list-utils-and list-1 list-2 nil nil ...))) :form (equal (a 1 2 3) (a 1 2 3)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (quote ...) (list-utils-and list-1 list-2 ...))) :form (equal (a a 1 2 3 3 3 4.0) (a a 1 2 3 3 3 4.0)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (quote ...) (list-utils-and list-1 list-2 ... nil ...))) :form (equal (a 1 2 3 4) (a 1 2 3 4)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (quote ...) (list-utils-and list-1 list-2 ...))) :form (equal (A a a 1 2 3 3 3) (A a a 1 2 3 3 3)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (quote ...) (list-utils-and list-1 list-2 ... nil ...))) :form (equal (a 1 2 3) (a 1 2 3)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (sort ... ...) (sort ... ...))) :form (equal (1 2 3 a) (1 2 3 a)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (number-sequence 4 10000) (list-utils-and list-1 list-2))) :form (equal (4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 ...) (4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 ...)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (list-utils-and list-1 list-2) (list-utils-and list-1 list-2 nil 10000))) :form (equal (4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 ...) (4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 ...)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (reverse ...) (list-utils-and list-1 list-2 nil nil ...))) :form (equal (10000 9999 9998 9997 9996 9995 9994 9993 9992 9991 9990 9989 9988 9987 9986 9985 9984 9983 9982 9981 9980 9979 9978 9977 9976 9975 9974 9973 9972 9971 9970 9969 9968 9967 9966 9965 9964 9963 9962 9961 9960 9959 9958 9957 9956 9955 9954 9953 9952 9951 ...) (10000 9999 9998 9997 9996 9995 9994 9993 9992 9991 9990 9989 9988 9987 9986 9985 9984 9983 9982 9981 9980 9979 9978 9977 9976 9975 9974 9973 9972 9971 9970 9969 9968 9967 9966 9965 9964 9963 9962 9961 9960 9959 9958 9957 9956 9955 9954 9953 9952 9951 ...)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (list-utils-and list-2 list-1) (list-utils-and list-1 list-2 nil nil ...))) :form (equal (10000 9999 9998 9997 9996 9995 9994 9993 9992 9991 9990 9989 9988 9987 9986 9985 9984 9983 9982 9981 9980 9979 9978 9977 9976 9975 9974 9973 9972 9971 9970 9969 9968 9967 9966 9965 9964 9963 9962 9961 9960 9959 9958 9957 9956 9955 9954 9953 9952 9951 ...) (10000 9999 9998 9997 9996 9995 9994 9993 9992 9991 9990 9989 9988 9987 9986 9985 9984 9983 9982 9981 9980 9979 9978 9977 9976 9975 9974 9973 9972 9971 9970 9969 9968 9967 9966 9965 9964 9963 9962 9961 9960 9959 9958 9957 9956 9955 9954 9953 9952 9951 ...)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (number-sequence 4 10000) (list-utils-and list-1 list-2 ...))) :form (equal (4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 ...) (4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 ...)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (mapcar ... ...) (list-utils-and list-1 list-2 ...))) :form (equal ("�" "�" "�" "�" "�" " " "\n" "�" "\f" "
" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" " " "!" "\"" "#" "$" "%" "&" "'" "(" ")" "*" "+" "," "-" "." "/" "0" "1" "2" "3" "4" "5" ...) ("�" "�" "�" "�" "�" "  " "\n" "�" "\f" "
" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" "�" " " "!" "\"" "#" "$" "%" "&" "'" "(" ")" "*" "+" "," "-" "." "/" "0" "1" "2" "3" "4" "5" ...)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (sort ... ...) (sort ... ...))) :form (equal (10 100 1000 10000 1001 1002 1003 1004 1005 1006 1007 1008 1009 101 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 102 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 103 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 104 1040 1041 1042 ...) (10 100 1000 10000 1001 1002 1003 1004 1005 1006 1007 1008 1009 101 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 102 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 103 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 104 1040 1041 1042 ...)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should-not (list-utils-cons-cell-p (quote ...))) :form (list-utils-cons-cell-p (a b c d e f)) :value nil))] [cl-struct-ert-test-passed "" (((should-not (list-utils-cons-cell-p nil)) :form (list-utils-cons-cell-p nil) :value nil))] [cl-struct-ert-test-passed "" (((should-not (list-utils-cons-cell-p 1)) :form (list-utils-cons-cell-p 1) :value nil))] [cl-struct-ert-test-passed "" (((should (= 2 (list-utils-cons-cell-p ...))) :form (= 2 2) :value t))] [cl-struct-ert-test-passed "" (((should (= 6 (list-utils-cons-cell-p ...))) :form (= 6 6) :value t))] [cl-struct-ert-test-passed "" (((should (= 8 (let ... ... ...))) :form (= 8 8) :value t))] [cl-struct-ert-test-passed "" (((should (= 7 (let ... ... ...))) :form (= 7 7) :value t))] [cl-struct-ert-test-passed "" (((should (= 1 (let ... ... ...))) :form (= 1 1) :value t))] [cl-struct-ert-test-passed "" (((should (= 0 (list-utils-cyclic-length ...))) :form (= 0 0) :value t))] [cl-struct-ert-test-passed "" (((should (= 0 (list-utils-cyclic-length ...))) :form (= 0 0) :value t))] [cl-struct-ert-test-passed "" (((should (= 1 (list-utils-cyclic-length cyclic))) :form (= 1 1) :value t))] [cl-struct-ert-test-passed "" (((should (let (...) (nconc cyclic cyclic) (list-utils-cyclic-p cyclic))) :form (let ((cyclic ...)) (nconc cyclic cyclic) (list-utils-cyclic-p cyclic)) :value (1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 . #7)))] [cl-struct-ert-test-passed "" (((should (let (...) (nconc cyclic cyclic) (list-utils-cyclic-p cyclic ...))) :form (let ((cyclic ...)) (nconc cyclic cyclic) (list-utils-cyclic-p cyclic (quote perfect))) :value (1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 . #7)))] [cl-struct-ert-test-passed "" (((should (let (...) (nconc cyclic ...) (list-utils-cyclic-p cyclic))) :form (let ((cyclic ...)) (nconc cyclic (cdr cyclic)) (list-utils-cyclic-p cyclic)) :value (8 2 3 4 5 6 7 8 2 3 4 5 6 . #6)))] [cl-struct-ert-test-passed "" (((should-not (let (...) (nconc cyclic ...) (list-utils-cyclic-p cyclic ...))) :form (let ((cyclic ...)) (nconc cyclic (cdr cyclic)) (list-utils-cyclic-p cyclic (quote perfect))) :value nil))] [cl-struct-ert-test-passed "" (((should (let (...) (nconc cyclic ...) (list-utils-cyclic-p cyclic))) :form (let ((cyclic ...)) (nconc cyclic (last cyclic)) (list-utils-cyclic-p cyclic)) :value (8 . #0)))] [cl-struct-ert-test-passed "" (((should-not (list-utils-cyclic-p (quote ...))) :form (list-utils-cyclic-p (1 2 3)) :value nil))] [cl-struct-ert-test-passed "" (((should-not (list-utils-cyclic-p nil)) :form (list-utils-cyclic-p nil) :value nil))] [cl-struct-ert-test-passed "" (((should-not (list-utils-cyclic-p (cons 1 2))) :form (list-utils-cyclic-p (1 . 2)) :value nil))] [cl-struct-ert-test-passed "" (((should-not (list-utils-cyclic-p (list* 1 2 3))) :form (list-utils-cyclic-p (1 2 . 3)) :value nil))] [cl-struct-ert-test-passed "" (((should (let (...) (nconc cyclic cyclic) (list-utils-cyclic-p cyclic))) :form (let ((cyclic ...)) (nconc cyclic cyclic) (list-utils-cyclic-p cyclic)) :value (1 . #0)))] [cl-struct-ert-test-passed "" (((should (equal (quote ...) (let ... ... ...))) :form (equal (1 2 3 4 5 6 7 8) (1 2 3 4 5 6 7 8)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (quote ...) (let ... ... ...))) :form (equal (2 3 4 5 6 7 8) (2 3 4 5 6 7 8)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (quote ...) (let ... ... ...))) :form (equal (2 3 4 5 6 7 8) (2 3 4 5 6 7 8)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should (equal (quote ...) (let ... ... ...))) :form (equal (8) (8)) :value t :explanation nil))] [cl-struct-ert-test-passed "" (((should-not (list-utils-cyclic-subseq (quote ...))) :form (list-utils-cyclic-subseq (1 2 3)) :value nil))] [cl-struct-ert-test-passed "" (((should-not (list-utils-cyclic-subseq nil)) :form (list-utils-cyclic-subseq nil) :value nil))] ...] [(22430 15718 700892 0) (22430 15718 701022 0) (22430 15718 701144 0) (22430 15718 701248 0) (22430 15718 701347 0) (22430 15718 701421 0) (22430 15718 701579 0) (22430 15718 701657 0) (22430 15718 701736 0) (22430 15718 701819 0) (22430 15718 701897 0) (22430 15718 701979 0) (22430 15718 702063 0) (22430 15718 702144 0) (22430 15718 702279 0) (22430 15718 702398 0) (22430 15718 702568 0) (22430 15718 720321 0) (22430 15718 754613 0) (22430 15718 773489 0) (22430 15718 794579 0) (22430 15718 820120 0) (22430 15719 140678 0) (22430 15720 175770 0) (22430 15720 175857 0) (22430 15720 175931 0) (22430 15720 176002 0) (22430 15720 176074 0) (22430 15720 176145 0) (22430 15720 176226 0) (22430 15720 176304 0) (22430 15720 176380 0) (22430 15720 176450 0) (22430 15720 176521 0) (22430 15720 176595 0) (22430 15720 176676 0) (22430 15720 176762 0) (22430 15720 176838 0) (22430 15720 176923 0) (22430 15720 177000 0) (22430 15720 177073 0) (22430 15720 177144 0) (22430 15720 177216 0) (22430 15720 177289 0) (22430 15720 177362 0) (22430 15720 177476 0) (22430 15720 177582 0) (22430 15720 177694 0) (22430 15720 177789 0) (22430 15720 177861 0) ...] [(22430 15718 700992 0) (22430 15718 701118 0) (22430 15718 701224 0) (22430 15718 701324 0) (22430 15718 701397 0) (22430 15718 701554 0) (22430 15718 701633 0) (22430 15718 701713 0) (22430 15718 701795 0) (22430 15718 701873 0) (22430 15718 701956 0) (22430 15718 702039 0) (22430 15718 702121 0) (22430 15718 702255 0) (22430 15718 702374 0) (22430 15718 702542 0) (22430 15718 720270 0) (22430 15718 754559 0) (22430 15718 773429 0) (22430 15718 794519 0) (22430 15718 820069 0) (22430 15719 140623 0) (22430 15720 175726 0) (22430 15720 175830 0) (22430 15720 175905 0) (22430 15720 175978 0) (22430 15720 176050 0) (22430 15720 176120 0) (22430 15720 176201 0) (22430 15720 176280 0) (22430 15720 176355 0) (22430 15720 176425 0) (22430 15720 176497 0) (22430 15720 176571 0) (22430 15720 176650 0) (22430 15720 176737 0) (22430 15720 176813 0) (22430 15720 176898 0) (22430 15720 176975 0) (22430 15720 177049 0) (22430 15720 177120 0) (22430 15720 177192 0) (22430 15720 177263 0) (22430 15720 177338 0) (22430 15720 177451 0) (22430 15720 177556 0) (22430 15720 177668 0) (22430 15720 177762 0) (22430 15720 177836 0) (22430 15720 177909 0) ...] 88 0 0 0 0 (22430 15718 700833 0) nil nil [cl-struct-ert-test list-utils-insert-after-04 nil (lambda nil (let ((fn-1391 (function list-utils-insert-after)) (args-1392 (list (quote ...) 6 (quote elt)))) (let ((value-1393 (quote ert-form-evaluation-aborted-1394))) (let (form-description-1395) (let (... ...) (condition-case -condition- ... ...) (if errorp1396 nil ...))) value-1393))) nil :passed nil] 0.0] [cl-struct-ert-test list-utils-insert-after-04 nil (lambda nil (let ((fn-1391 (function list-utils-insert-after)) (args-1392 (list (quote (1 2 3 4 5)) 6 (quote elt)))) (let ((value-1393 (quote ert-form-evaluation-aborted-1394))) (let (form-description-1395) (let ((errorp1396 nil) (form-description-fn-1397 ...)) (condition-case -condition- (unwind-protect ... ... ...) (error ... ... ...)) (if errorp1396 nil (ert-fail ...)))) value-1393))) nil :passed nil] #[385 "\306�\307\"\203G\211\211G\310U\203�\211@\202�\311\312\313�GD\"\314\315�\316H�>\204,\311\317\320�D\"\210�\321HG\322�\316H�>\204A\311\317\320��D\"\210�\323H!#\207\306�\324\"\203\303�\211\211G\321U\203_\211�A\262�\242\202f\311\312\313�GD\"�@\325�!\326�!�\316H�>\204~\311\317\320��D\"\210�\327H\314\330�\204\213\331\202\214\332\333��!\334� !��\316U\203\237\331\202\244\335\336�   \"��\316U\203\257\331\202\264\335\337�  \"\322�\f\316H�>\204\306\311\317\320��D\"\210�\f\340H!��\316U\203\326\331\202\333\335\341�\n\"&�\210�\316U\204O�\314\342�\"\210�\316H�>\204\371\311\317\320��D\"\210�\321H\343\313\211�T\211\262��GW\203H���H\262��\316H    >\204��\311\317\344�D\"\210�\345H\262�\346��\"\204\377\314\347\350�\313\"�\316H >\204@�\311\317\344��D\"\210�\310H#\210\202\377\266�\314\351\331\"\210�\316U?\205\300�\314\352�\"\210�\316H�>\204k�\311\317\320��D\"\210�\321H\343\313\211�T\211\262��GW\203\272���H\262��\316H >\204\220�\311\317\344�D\"\210�\345H\262�\353�\354\"\203q�\314\347\350�\313\"�\316H >\204\262�\311\317\344��D\"\210�\310H#\210\202q�\266�\314\351\331\"\266\203\207\306�\355\"\203\314�\313\207\306�\356\"\203\354�\211\211G\357U\203\344�\211�A\262�\242\202\353�\311\312\313�GD\"�\211A\262�\242�@\346��\"\204\225�\360�!\203)�\211G\357Y\203)�\211\316H\n>\203)�\314\361�\316H   >\204!�\311\317\344��D\"\210�\310H\"\210\202\225�\360�!\203%�\211G\362Y\203%�\211\316H�>\203%�\314\363�\316H    >\204P�\311\317\344��D\"\210�\310H\"\210\364\365!r\211q\210\366\316\367\370\371�!\372\"\321$\216\373�\316H�>\204x�\311\317\374�D\"\210�\345H!\210eb\210m\204\237�`\313�\210`\211�\f\\^\262�\314\351\375��\"\"\266�\310y\210\202\200�*\210\364\365!r\211q\210\366\316\367\370\371�!\376\"\321$\216\377�!\210\201Dc\210\201E\201F\201G��@�A\201H�\316H�>\204\335�\311\317\374�D\"\210�\357H!\210+dSb\210\201I\201J!\204\371�\201K\201L!\210\201M\310!\210\314\201N�\316H  >\204��\311\317\344��D\"\210�\310H\"\210\314\351\201O \"\210*\210\202\225�\360�!\203W�\211G\357Y\203W�\211\316H�B>\203W�\314\201P�\316H >\204O�\311\317\344��D\"\210�\310H\"\210\202\225�\360�!\203\211�\211G\362Y\203\211�\211\316H�C>\203\211�\314\201Q�\316H >\204\201�\311\317\344��D\"\210�\310H\"\210\202\225�\201R\201S�\201T#\210\201U�\316H�>\204\250�\311\317\320��D\"\210�\321HG!\201V\201U�G!\201W�\201X\260�\314�\350�\346����\"\"\201Y����\"T��\316H  >\204\344�\311\317\344�\nD\"\210��\310H$\266\202\207\201R\201Z�\201[#\205\373�\313\207" [cl-struct-ert--stats-tags cl-struct-ert-test-tags cl-struct-ert-test-passed-tags cl-struct-ert-test-result-with-condition-tags ert-batch-backtrace-right-margin print-length eql run-started 1 signal wrong-number-of-arguments nil message "Running %s tests (%s)" 0 wrong-type-argument ert--stats 2 ert--format-time-iso8601 12 run-ended ert-stats-completed-unexpected ert-stats-skipped 9 "\n%sRan %s tests, %s results as expected%s%s (%s)%s\n" "" "Aborted: " ert-stats-total ert-stats-completed-expected format ", %s unexpected" ", %s skipped" 13 "\n%s expected failures" "%s unexpected results:" -1 ert-test 4 ert-test-result-expected-p "%9s  %S" ert-string-for-test-result "%s" "%s skipped results:" ert-test-result-type-p :skipped test-started test-ended 3 vectorp "Test %S passed unexpectedly" ...] 20 "\n\n(fn EVENT-TYPE &rest EVENT-ARGS)"])
  ert-run-tests((and "" (not (tag :interactive))) #[385 "\306�\307\"\203G\211\211G\310U\203�\211@\202�\311\312\313�GD\"\314\315�\316H�>\204,\311\317\320�D\"\210�\321HG\322�\316H�>\204A\311\317\320��D\"\210�\323H!#\207\306�\324\"\203\303�\211\211G\321U\203_\211�A\262�\242\202f\311\312\313�GD\"�@\325�!\326�!�\316H�>\204~\311\317\320��D\"\210�\327H\314\330�\204\213\331\202\214\332\333��!\334�    !��\316U\203\237\331\202\244\335\336�   \"��\316U\203\257\331\202\264\335\337�  \"\322�\f\316H�>\204\306\311\317\320��D\"\210�\f\340H!��\316U\203\326\331\202\333\335\341�\n\"&�\210�\316U\204O�\314\342�\"\210�\316H�>\204\371\311\317\320��D\"\210�\321H\343\313\211�T\211\262��GW\203H���H\262��\316H    >\204��\311\317\344�D\"\210�\345H\262�\346��\"\204\377\314\347\350�\313\"�\316H >\204@�\311\317\344��D\"\210�\310H#\210\202\377\266�\314\351\331\"\210�\316U?\205\300�\314\352�\"\210�\316H�>\204k�\311\317\320��D\"\210�\321H\343\313\211�T\211\262��GW\203\272���H\262��\316H >\204\220�\311\317\344�D\"\210�\345H\262�\353�\354\"\203q�\314\347\350�\313\"�\316H >\204\262�\311\317\344��D\"\210�\310H#\210\202q�\266�\314\351\331\"\266\203\207\306�\355\"\203\314�\313\207\306�\356\"\203\354�\211\211G\357U\203\344�\211�A\262�\242\202\353�\311\312\313�GD\"�\211A\262�\242�@\346��\"\204\225�\360�!\203)�\211G\357Y\203)�\211\316H\n>\203)�\314\361�\316H   >\204!�\311\317\344��D\"\210�\310H\"\210\202\225�\360�!\203%�\211G\362Y\203%�\211\316H�>\203%�\314\363�\316H    >\204P�\311\317\344��D\"\210�\310H\"\210\364\365!r\211q\210\366\316\367\370\371�!\372\"\321$\216\373�\316H�>\204x�\311\317\374�D\"\210�\345H!\210eb\210m\204\237�`\313�\210`\211�\f\\^\262�\314\351\375��\"\"\266�\310y\210\202\200�*\210\364\365!r\211q\210\366\316\367\370\371�!\376\"\321$\216\377�!\210\201Dc\210\201E\201F\201G��@�A\201H�\316H�>\204\335�\311\317\374�D\"\210�\357H!\210+dSb\210\201I\201J!\204\371�\201K\201L!\210\201M\310!\210\314\201N�\316H  >\204��\311\317\344��D\"\210�\310H\"\210\314\351\201O \"\210*\210\202\225�\360�!\203W�\211G\357Y\203W�\211\316H�B>\203W�\314\201P�\316H >\204O�\311\317\344��D\"\210�\310H\"\210\202\225�\360�!\203\211�\211G\362Y\203\211�\211\316H�C>\203\211�\314\201Q�\316H >\204\201�\311\317\344��D\"\210�\310H\"\210\202\225�\201R\201S�\201T#\210\201U�\316H�>\204\250�\311\317\320��D\"\210�\321HG!\201V\201U�G!\201W�\201X\260�\314�\350�\346����\"\"\201Y����\"T��\316H  >\204\344�\311\317\344�\nD\"\210��\310H$\266\202\207\201R\201Z�\201[#\205\373�\313\207" [cl-struct-ert--stats-tags cl-struct-ert-test-tags cl-struct-ert-test-passed-tags cl-struct-ert-test-result-with-condition-tags ert-batch-backtrace-right-margin print-length eql run-started 1 signal wrong-number-of-arguments nil message "Running %s tests (%s)" 0 wrong-type-argument ert--stats 2 ert--format-time-iso8601 12 run-ended ert-stats-completed-unexpected ert-stats-skipped 9 "\n%sRan %s tests, %s results as expected%s%s (%s)%s\n" "" "Aborted: " ert-stats-total ert-stats-completed-expected format ", %s unexpected" ", %s skipped" 13 "\n%s expected failures" "%s unexpected results:" -1 ert-test 4 ert-test-result-expected-p "%9s  %S" ert-string-for-test-result "%s" "%s skipped results:" ert-test-result-type-p :skipped test-started test-ended 3 vectorp "Test %S passed unexpectedly" ...] 20 "\n\n(fn EVENT-TYPE &rest EVENT-ARGS)"])
  ert-run-tests-batch((and "" (not (tag :interactive))))
  ert-run-tests-batch-and-exit((and "" (not (tag :interactive))))
  (progn (fset (quote ert--print-backtrace) (quote ignore)) (ert-run-tests-batch-and-exit (quote (and "" (not (tag :interactive))))))
  eval((progn (fset (quote ert--print-backtrace) (quote ignore)) (ert-run-tests-batch-and-exit (quote (and "" (not (tag :interactive)))))))
  command-line-1(("-L" "." "-L" ".." "-l" "cl" "-l" "ert" "-l" "list-utils-test.el" "--eval" "(progn                                                (fset 'ert--print-backtrace 'ignore)                 (ert-run-tests-batch-and-exit '(and \"\" (not (tag :interactive)))))"))
  command-line()
  normal-top-level()

Let me know if there's other information you need!

Relation to -dash.el?

Are you aware of dash.el? I has become more or less a de facto standard library in the Emacs Lisp community, as it covers a wide range of list processing needs.

Did you think about contributing your functions to this library?

let: Symbol's function definition is void: macroexpand-1

Please note that I have added the following files to emacs:

unicode-fonts.el
font-utils.el
ucs-utils.el
list-utils.el

Why I try to re-load my .emacs, this is the error I'm getting:

let: Symbol's function definition is void: macroexpand-1

Based on your quickstarts, this is what I have added to my .emacs:

;;
(require 'list-utils)

(list-utils-flatten '(1 2 (3 4 (5 6 7))))
;; '(1 2 3 4 5 6 7)

(list-utils-depth '(1 2 (3 4 (5 6 7))))
;; 3

(let ((cyclic-list '(1 2 3 4 5 6 7)))
  (nconc cyclic-list (cdr cyclic-list))
  (list-utils-make-linear-inplace cyclic-list))
;; '(1 2 3 4 5 6 7)

(list-utils-cyclic-p '(1 2 3))
;; nil

(list-utils-plist-del '(:one 1 :two 2 :three 3) :two)
;; '(:one 1 :three 3)

;;

(require 'ucs-utils)

(ucs-utils-char "Middle Dot"         ; character to return
                ?.                   ; fallback if unavailable
                'char-displayable-p) ; test for character to pass

(ucs-utils-first-existing-char '("White Bullet"
                                 "Bullet Operator"
                                 "Circled Bullet"
                                 "Middle Dot"
                                 ?.) 'cdp)

(ucs-utils-string "Horizontal Ellipsis" '[["..."]])

;;

(require 'font-utils)
(font-utils-exists-p "Courier")

;;

(require 'unicode-fonts)
(unicode-fonts-setup)

Do you have any suggestions? TIA.

Makefile: issues with RESOLVED_EMACS

By default readlink produces relative paths, so when Emacs is installed through Homebrew the make tasks fail since RESOLVED_EMACS is set to something like

../Cellar/emacs-edge/25.1-rc1/bin/emacs

And unfortunately the -f flag isn't available on the version of readlink included with macOS.

The Makefile could be changed to something like this

diff --git a/Makefile b/Makefile
index 777dd06..73c9dae 100644
--- a/Makefile
+++ b/Makefile
@@ -13,8 +13,13 @@ INTERACTIVE_EMACS=/usr/local/bin/emacs
 # INTERACTIVE_EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs
 # INTERACTIVE_EMACS=/Applications/Emacs.app/Contents/MacOS/bin/emacs

-RESOLVED_EMACS=$(shell readlink `which $(EMACS)` || echo "$(EMACS)")
-RESOLVED_INTERACTIVE_EMACS=$(shell readlink `which "$(INTERACTIVE_EMACS)"` || echo "$(INTERACTIVE_EMACS)")
+ifeq ($(shell uname), "Darwin")
+       RESOLVED_EMACS=${EMACS}
+       RESOLVED_INTERACTIVE_EMACS=${INTERACTIVE_EMACS}
+else
+       RESOLVED_EMACS=$(shell readlink -f `which $(EMACS)` || echo "$(EMACS)")
+       RESOLVED_INTERACTIVE_EMACS=$(shell readlink -f `which "$(INTERACTIVE_EMACS)"` || echo "$(INTERACTIVE_EMACS)")
+endif

 EMACS_CLEAN=-Q
 EMACS_BATCH=$(EMACS_CLEAN) --batch

But could the resolving logic be removed from the Makefile entirely? When is it necessary?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.