diff --git a/elpa/dash-20220417.2250/dash-autoloads.el b/elpa/dash-20220608.1931/dash-autoloads.el similarity index 62% rename from elpa/dash-20220417.2250/dash-autoloads.el rename to elpa/dash-20220608.1931/dash-autoloads.el index 3a96693..136ed92 100644 --- a/elpa/dash-20220417.2250/dash-autoloads.el +++ b/elpa/dash-20220608.1931/dash-autoloads.el @@ -1,4 +1,4 @@ -;;; dash-autoloads.el --- automatically extracted autoloads +;;; dash-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*- ;; ;;; Code: @@ -12,10 +12,19 @@ (autoload 'dash-fontify-mode "dash" "\ Toggle fontification of Dash special variables. -If called interactively, enable Dash-Fontify mode if ARG is -positive, and disable it if ARG is zero or negative. If called -from Lisp, also enable the mode if ARG is omitted or nil, and -toggle it if ARG is `toggle'; disable the mode otherwise. +This is a minor mode. If called interactively, toggle the +`Dash-Fontify mode' mode. If the prefix argument is positive, +enable the mode, and if it is zero or negative, disable the mode. + +If called from Lisp, toggle the mode if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. +Disable the mode if ARG is a negative number. + +To check whether the minor mode is enabled in the current buffer, +evaluate `dash-fontify-mode'. + +The mode's hook is called both when the mode is enabled and when +it is disabled. Dash-Fontify mode is a buffer-local minor mode intended for Emacs Lisp buffers. Enabling it causes the special variables bound in @@ -43,12 +52,16 @@ or call the function `global-dash-fontify-mode'.") (autoload 'global-dash-fontify-mode "dash" "\ Toggle Dash-Fontify mode in all buffers. -With prefix ARG, enable Global Dash-Fontify mode if ARG is positive; -otherwise, disable it. If called from Lisp, enable the mode if -ARG is omitted or nil. +With prefix ARG, enable Global Dash-Fontify mode if ARG is positive; otherwise, +disable it. + +If called from Lisp, toggle the mode if ARG is `toggle'. +Enable the mode if ARG is nil, omitted, or is a positive number. +Disable the mode if ARG is a negative number. + +Dash-Fontify mode is enabled in all buffers where `dash--turn-on-fontify-mode' +would do it. -Dash-Fontify mode is enabled in all buffers where -`dash--turn-on-fontify-mode' would do it. See `dash-fontify-mode' for more information on Dash-Fontify mode. \(fn &optional ARG)" t nil) @@ -57,7 +70,7 @@ See `dash-fontify-mode' for more information on Dash-Fontify mode. Register the Dash Info manual with `info-lookup-symbol'. This allows Dash symbols to be looked up with \\[info-lookup-symbol]." t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "dash" '("!cdr" "!cons" "--" "->" "-a" "-butlast" "-c" "-d" "-e" "-f" "-gr" "-i" "-juxt" "-keep" "-l" "-m" "-no" "-o" "-p" "-r" "-s" "-t" "-u" "-value-to-list" "-when-let" "-zip" "dash-"))) +(register-definition-prefixes "dash" '("!cdr" "!cons" "--" "->" "-a" "-butlast" "-c" "-d" "-e" "-f" "-gr" "-i" "-juxt" "-keep" "-l" "-m" "-no" "-o" "-p" "-r" "-s" "-t" "-u" "-value-to-list" "-when-let" "-zip" "dash-")) ;;;*** diff --git a/elpa/dash-20220417.2250/dash-pkg.el b/elpa/dash-20220608.1931/dash-pkg.el similarity index 67% rename from elpa/dash-20220417.2250/dash-pkg.el rename to elpa/dash-20220608.1931/dash-pkg.el index 98425a8..36accb0 100644 --- a/elpa/dash-20220417.2250/dash-pkg.el +++ b/elpa/dash-20220608.1931/dash-pkg.el @@ -1,6 +1,6 @@ -(define-package "dash" "20220417.2250" "A modern list library for Emacs" +(define-package "dash" "20220608.1931" "A modern list library for Emacs" '((emacs "24")) - :commit "7fd71338dce041b352f84e7939f6966f4d379459" :authors + :commit "0ac1ecf6b56eb67bb81a3cf70f8d4354b5782341" :authors '(("Magnar Sveen" . "magnars@gmail.com")) :maintainer '("Magnar Sveen" . "magnars@gmail.com") diff --git a/elpa/dash-20220417.2250/dash.el b/elpa/dash-20220608.1931/dash.el similarity index 82% rename from elpa/dash-20220417.2250/dash.el rename to elpa/dash-20220608.1931/dash.el index 26e1f8b..e04201f 100644 --- a/elpa/dash-20220417.2250/dash.el +++ b/elpa/dash-20220608.1931/dash.el @@ -29,11 +29,19 @@ ;;; Code: -;; TODO: `gv' was introduced in Emacs 24.3, so remove this and all -;; calls to `defsetf' when support for earlier versions is dropped. (eval-when-compile + ;; TODO: Emacs 24.3 first introduced `gv', so remove this and all + ;; calls to `defsetf' when support for earlier versions is dropped. (unless (fboundp 'gv-define-setter) - (require 'cl))) + (require 'cl)) + + ;; TODO: Emacs versions 24.3..24.5 complain about unknown `declare' + ;; props, so remove this when support for those versions is dropped. + (and (< emacs-major-version 25) + (boundp 'defun-declarations-alist) + (dolist (prop '(pure side-effect-free)) + (unless (assq prop defun-declarations-alist) + (push (list prop #'ignore) defun-declarations-alist))))) (defgroup dash () "Customize group for Dash, a modern list library." @@ -60,12 +68,12 @@ This is the anaphoric counterpart to `-each'." (let ((l (make-symbol "list")) (i (make-symbol "i"))) `(let ((,l ,list) - (,i 0) - it it-index) - (ignore it it-index) + (,i 0)) (while ,l - (setq it (pop ,l) it-index ,i ,i (1+ ,i)) - ,@body)))) + (let ((it (pop ,l)) (it-index ,i)) + (ignore it it-index) + ,@body) + (setq ,i (1+ ,i)))))) (defun -each (list fn) "Call FN on each element of LIST. @@ -102,11 +110,16 @@ This is the anaphoric counterpart to `-each-while'." (elt (make-symbol "elt"))) `(let ((,l ,list) (,i 0) - ,elt it it-index) - (ignore it it-index) - (while (and ,l (setq ,elt (pop ,l) it ,elt it-index ,i) ,pred) - (setq it ,elt it-index ,i ,i (1+ ,i)) - ,@body)))) + ,elt) + (while (when ,l + (setq ,elt (car-safe ,l)) + (let ((it ,elt) (it-index ,i)) + (ignore it it-index) + ,pred)) + (let ((it ,elt) (it-index ,i)) + (ignore it it-index) + ,@body) + (setq ,i (1+ ,i) ,l (cdr ,l)))))) (defun -each-while (list pred fn) "Call FN on each ITEM in LIST, while (PRED ITEM) is non-nil. @@ -373,7 +386,9 @@ This is the anaphoric counterpart to `-reductions'." `(let ((,lv ,list)) (if ,lv (--reductions-from ,form (car ,lv) (cdr ,lv)) - (let (acc it) + ;; Explicit nil binding pacifies lexical "variable left uninitialized" + ;; warning. See issue #377 and upstream https://bugs.gnu.org/47080. + (let ((acc nil) (it nil)) (ignore acc it) (list ,form)))))) @@ -642,7 +657,9 @@ See also: `-map-when', `-replace-first'" (defmacro --map-first (pred rep list) "Anaphoric form of `-map-first'." (declare (debug (def-form def-form form))) - `(-map-first (lambda (it) ,pred) (lambda (it) (ignore it) ,rep) ,list)) + `(-map-first (lambda (it) (ignore it) ,pred) + (lambda (it) (ignore it) ,rep) + ,list)) (defun -map-last (pred rep list) "Use PRED to determine the last item in LIST to call REP on. @@ -655,7 +672,9 @@ See also: `-map-when', `-replace-last'" (defmacro --map-last (pred rep list) "Anaphoric form of `-map-last'." (declare (debug (def-form def-form form))) - `(-map-last (lambda (it) ,pred) (lambda (it) (ignore it) ,rep) ,list)) + `(-map-last (lambda (it) (ignore it) ,pred) + (lambda (it) (ignore it) ,rep) + ,list)) (defun -replace (old new list) "Replace all OLD items in LIST with NEW. @@ -750,28 +769,45 @@ See also: `-flatten'" \(fn LIST)") -(defun -splice (pred fun list) - "Splice lists generated by FUN in place of elements matching PRED in LIST. - -FUN takes the element matching PRED as input. - -This function can be used as replacement for `,@' in case you -need to splice several lists at marked positions (for example -with keywords). - -See also: `-splice-list', `-insert-at'" - (let (r) - (--each list - (if (funcall pred it) - (let ((new (funcall fun it))) - (--each new (!cons it r))) - (!cons it r))) - (nreverse r))) - (defmacro --splice (pred form list) - "Anaphoric form of `-splice'." - (declare (debug (def-form def-form form))) - `(-splice (lambda (it) ,pred) (lambda (it) ,form) ,list)) + "Splice lists generated by FORM in place of items satisfying PRED in LIST. + +Evaluate PRED for each element of LIST in turn bound to `it'. +Whenever the result of PRED is nil, leave that `it' is-is. +Otherwise, evaluate FORM with the same `it' binding still in +place. The result should be a (possibly empty) list of items to +splice in place of `it' in LIST. + +This can be useful as an alternative to the `,@' construct in a +`\\=`' structure, in case you need to splice several lists at +marked positions (for example with keywords). + +This is the anaphoric counterpart to `-splice'." + (declare (debug (form form form))) + (let ((r (make-symbol "result"))) + `(let (,r) + (--each ,list + (if ,pred + (--each ,form (push it ,r)) + (push it ,r))) + (nreverse ,r)))) + +(defun -splice (pred fun list) + "Splice lists generated by FUN in place of items satisfying PRED in LIST. + +Call PRED on each element of LIST. Whenever the result of PRED +is nil, leave that `it' as-is. Otherwise, call FUN on the same +`it' that satisfied PRED. The result should be a (possibly +empty) list of items to splice in place of `it' in LIST. + +This can be useful as an alternative to the `,@' construct in a +`\\=`' structure, in case you need to splice several lists at +marked positions (for example with keywords). + +This function's anaphoric counterpart is `--splice'. + +See also: `-splice-list', `-insert-at'." + (--splice (funcall pred it) (funcall fun it) list)) (defun -splice-list (pred new-list list) "Splice NEW-LIST in place of elements matching PRED in LIST. @@ -782,7 +818,7 @@ See also: `-splice', `-insert-at'" (defmacro --splice-list (pred new-list list) "Anaphoric form of `-splice-list'." (declare (debug (def-form form form))) - `(-splice-list (lambda (it) ,pred) ,new-list ,list)) + `(-splice-list (lambda (it) (ignore it) ,pred) ,new-list ,list)) (defun -cons* (&rest args) "Make a new list from the elements of ARGS. @@ -822,14 +858,16 @@ This is the anaphoric counterpart to `-first'." (defun -first (pred list) "Return the first item in LIST for which PRED returns non-nil. Return nil if no such element is found. -To get the first item in the list no questions asked, use `car'. + +To get the first item in the list no questions asked, +use `-first-item'. Alias: `-find'. This function's anaphoric counterpart is `--first'." (--first (funcall pred it) list)) -(defalias '-find '-first) +(defalias '-find #'-first) (defalias '--find '--first) (defmacro --some (form list) @@ -898,10 +936,10 @@ This function's anaphoric counterpart is `--every'." "Return the last x in LIST where (PRED x) is non-nil, else nil." (--last (funcall pred it) list)) -(defalias '-first-item 'car +(defalias '-first-item #'car "Return the first item of LIST, or nil on an empty list. -See also: `-second-item', `-last-item'. +See also: `-second-item', `-last-item', etc. \(fn LIST)") @@ -909,40 +947,56 @@ See also: `-second-item', `-last-item'. ;; just like `car'. (put '-first-item 'byte-opcode 'byte-car) (put '-first-item 'byte-compile 'byte-compile-one-arg) +(put '-first-item 'pure t) +(put '-first-item 'side-effect-free t) -(defalias '-second-item 'cadr +(defalias '-second-item #'cadr "Return the second item of LIST, or nil if LIST is too short. -See also: `-third-item'. +See also: `-first-item', `-third-item', etc. \(fn LIST)") +(put '-second-item 'pure t) +(put '-second-item 'side-effect-free t) + (defalias '-third-item (if (fboundp 'caddr) #'caddr (lambda (list) (car (cddr list)))) "Return the third item of LIST, or nil if LIST is too short. -See also: `-fourth-item'. +See also: `-second-item', `-fourth-item', etc. \(fn LIST)") -(defun -fourth-item (list) +(put '-third-item 'pure t) +(put '-third-item 'side-effect-free t) + +(defalias '-fourth-item + (if (fboundp 'cadddr) + #'cadddr + (lambda (list) (cadr (cddr list)))) "Return the fourth item of LIST, or nil if LIST is too short. -See also: `-fifth-item'." - (declare (pure t) (side-effect-free t)) - (car (cdr (cdr (cdr list))))) +See also: `-third-item', `-fifth-item', etc. + +\(fn LIST)") + +(put '-fourth-item 'pure t) +(put '-fourth-item 'side-effect-free t) (defun -fifth-item (list) "Return the fifth item of LIST, or nil if LIST is too short. -See also: `-last-item'." +See also: `-fourth-item', `-last-item', etc." (declare (pure t) (side-effect-free t)) - (car (cdr (cdr (cdr (cdr list)))))) + (car (cddr (cddr list)))) (defun -last-item (list) - "Return the last item of LIST, or nil on an empty list." + "Return the last item of LIST, or nil on an empty list. + +See also: `-first-item', etc." (declare (pure t) (side-effect-free t)) (car (last list))) @@ -974,7 +1028,7 @@ See also: `-last-item'." (defun ---truthy? (obj) "Return OBJ as a boolean value (t or nil)." - (declare (pure t) (side-effect-free t)) + (declare (pure t) (side-effect-free error-free)) (and obj t)) (defmacro --any? (form list) @@ -1233,7 +1287,7 @@ See also: `-map-when'" (defmacro --update-at (n form list) "Anaphoric version of `-update-at'." (declare (debug (form def-form form))) - `(-update-at ,n (lambda (it) ,form) ,list)) + `(-update-at ,n (lambda (it) (ignore it) ,form) ,list)) (defun -remove-at (n list) "Return a list with element at Nth position in LIST removed. @@ -1302,7 +1356,7 @@ See also `-split-when'" (defmacro --split-when (form list) "Anaphoric version of `-split-when'." (declare (debug (def-form form))) - `(-split-when (lambda (it) ,form) ,list)) + `(-split-when (lambda (it) (ignore it) ,form) ,list)) (defun -split-when (fn list) "Split the LIST on each element where FN returns non-nil. @@ -1650,21 +1704,36 @@ from the beginning." (nconc newlist newlist))) (defun -pad (fill-value &rest lists) - "Appends FILL-VALUE to the end of each list in LISTS such that they -will all have the same length." - (let* ((annotations (-annotate 'length lists)) - (n (-max (-map 'car annotations)))) - (--map (append (cdr it) (-repeat (- n (car it)) fill-value)) annotations))) + "Pad each of LISTS with FILL-VALUE until they all have equal lengths. -(defun -annotate (fn list) - "Return a list of cons cells where each cell is FN applied to each -element of LIST paired with the unmodified element of LIST." - (-zip (-map fn list) list)) +Ensure all LISTS are as long as the longest one by repeatedly +appending FILL-VALUE to the shorter lists, and return the +resulting LISTS." + (declare (pure t) (side-effect-free t)) + (let* ((lens (mapcar #'length lists)) + (maxlen (apply #'max 0 lens))) + (--map (append it (make-list (- maxlen (pop lens)) fill-value)) lists))) (defmacro --annotate (form list) - "Anaphoric version of `-annotate'." - (declare (debug (def-form form))) - `(-annotate (lambda (it) ,form) ,list)) + "Pair each item in LIST with the result of evaluating FORM. + +Return an alist of (RESULT . ITEM), where each ITEM is the +corresponding element of LIST, and RESULT is the value obtained +by evaluating FORM with ITEM bound to `it'. + +This is the anaphoric counterpart to `-annotate'." + (declare (debug (form form))) + `(--map (cons ,form it) ,list)) + +(defun -annotate (fn list) + "Pair each item in LIST with the result of passing it to FN. + +Return an alist of (RESULT . ITEM), where each ITEM is the +corresponding element of LIST, and RESULT is the value obtained +by calling FN on ITEM. + +This function's anaphoric counterpart is `--annotate'." + (--annotate (funcall fn it) list)) (defun dash--table-carry (lists restore-lists &optional re) "Helper for `-table' and `-table-flat'. @@ -1728,54 +1797,88 @@ See also: `-flatten-n', `-table'" (dash--table-carry lists restore-lists))) (nreverse re))) -(defun -elem-index (elem list) - "Return the index of the first element in the given LIST which -is equal to the query element ELEM, or nil if there is no -such element." - (declare (pure t) (side-effect-free t)) - (car (-elem-indices elem list))) - -(defun -elem-indices (elem list) - "Return the indices of all elements in LIST equal to the query -element ELEM, in ascending order." - (declare (pure t) (side-effect-free t)) - (-find-indices (-partial 'equal elem) list)) - -(defun -find-indices (pred list) - "Return the indices of all elements in LIST satisfying the -predicate PRED, in ascending order." - (apply 'append (--map-indexed (when (funcall pred it) (list it-index)) list))) - -(defmacro --find-indices (form list) - "Anaphoric version of `-find-indices'." - (declare (debug (def-form form))) - `(-find-indices (lambda (it) ,form) ,list)) +(defmacro --find-index (form list) + "Return the first index in LIST for which FORM evals to non-nil. +Return nil if no such index is found. +Each element of LIST in turn is bound to `it' and its index +within LIST to `it-index' before evaluating FORM. +This is the anaphoric counterpart to `-find-index'." + (declare (debug (form form))) + `(--some (and ,form it-index) ,list)) (defun -find-index (pred list) - "Take a predicate PRED and a LIST and return the index of the -first element in the list satisfying the predicate, or nil if -there is no such element. + "Return the index of the first item satisfying PRED in LIST. +Return nil if no such item is found. -See also `-first'." - (car (-find-indices pred list))) +PRED is called with one argument, the current list element, until +it returns non-nil, at which point the search terminates. -(defmacro --find-index (form list) - "Anaphoric version of `-find-index'." - (declare (debug (def-form form))) - `(-find-index (lambda (it) ,form) ,list)) +This function's anaphoric counterpart is `--find-index'. -(defun -find-last-index (pred list) - "Take a predicate PRED and a LIST and return the index of the -last element in the list satisfying the predicate, or nil if -there is no such element. +See also: `-first', `-find-last-index'." + (--find-index (funcall pred it) list)) -See also `-last'." - (-last-item (-find-indices pred list))) +(defun -elem-index (elem list) + "Return the first index of ELEM in LIST. +That is, the index within LIST of the first element that is +`equal' to ELEM. Return nil if there is no such element. + +See also: `-find-index'." + (declare (pure t) (side-effect-free t)) + (--find-index (equal elem it) list)) + +(defmacro --find-indices (form list) + "Return the list of indices in LIST for which FORM evals to non-nil. +Each element of LIST in turn is bound to `it' and its index +within LIST to `it-index' before evaluating FORM. +This is the anaphoric counterpart to `-find-indices'." + (declare (debug (form form))) + `(--keep (and ,form it-index) ,list)) + +(defun -find-indices (pred list) + "Return the list of indices in LIST satisfying PRED. + +Each element of LIST in turn is passed to PRED. If the result is +non-nil, the index of that element in LIST is included in the +result. The returned indices are in ascending order, i.e., in +the same order as they appear in LIST. + +This function's anaphoric counterpart is `--find-indices'. + +See also: `-find-index', `-elem-indices'." + (--find-indices (funcall pred it) list)) + +(defun -elem-indices (elem list) + "Return the list of indices at which ELEM appears in LIST. +That is, the indices of all elements of LIST `equal' to ELEM, in +the same ascending order as they appear in LIST." + (declare (pure t) (side-effect-free t)) + (--find-indices (equal elem it) list)) (defmacro --find-last-index (form list) - "Anaphoric version of `-find-last-index'." - (declare (debug (def-form form))) - `(-find-last-index (lambda (it) ,form) ,list)) + "Return the last index in LIST for which FORM evals to non-nil. +Return nil if no such index is found. +Each element of LIST in turn is bound to `it' and its index +within LIST to `it-index' before evaluating FORM. +This is the anaphoric counterpart to `-find-last-index'." + (declare (debug (form form))) + (let ((i (make-symbol "index"))) + `(let (,i) + (--each ,list + (when ,form (setq ,i it-index))) + ,i))) + +(defun -find-last-index (pred list) + "Return the index of the last item satisfying PRED in LIST. +Return nil if no such item is found. + +Predicate PRED is called with one argument each time, namely the +current list element. + +This function's anaphoric counterpart is `--find-last-index'. + +See also: `-last', `-find-index'." + (--find-last-index (funcall pred it) list)) (defun -select-by-indices (indices list) "Return a list whose elements are elements from LIST selected @@ -2214,7 +2317,9 @@ matchers based on the type of the expression. Key-value stores are disambiguated by placing a token &plist, &alist or &hash as a first item in the MATCH-FORM." (cond - ((symbolp match-form) + ((and (symbolp match-form) + ;; Don't bind things like &keys as if they were vars (#395). + (not (functionp (dash--get-expand-function match-form)))) (dash--match-symbol match-form source)) ((consp match-form) (cond @@ -2369,7 +2474,7 @@ patterns be optionally left out and derived from the key name in the following fashion: - a key :foo is converted into `foo' pattern, -- a key 'bar is converted into `bar' pattern, +- a key \\='bar is converted into `bar' pattern, - a key \"baz\" is converted into `baz' pattern. That is, the entire value under the key is bound to the derived @@ -2383,10 +2488,10 @@ invalid spec fails with an error. Thus the patterns are normalized as follows: ;; derive all the missing patterns - (&plist :foo 'bar \"baz\") => (&plist :foo foo 'bar bar \"baz\" baz) + (&plist :foo \\='bar \"baz\") => (&plist :foo foo \\='bar bar \"baz\" baz) ;; we can specify some but not others - (&plist :foo 'bar explicit-bar) => (&plist :foo foo 'bar explicit-bar) + (&plist :foo \\='bar explicit-bar) => (&plist :foo foo \\='bar explicit-bar) ;; nothing happens, we store :foo in x (&plist :foo x) => (&plist :foo x) @@ -2600,83 +2705,311 @@ execute body." (indent 1)) `(--if-let ,val (progn ,@body))) +;; TODO: Get rid of this dynamic variable, passing it as an argument +;; instead? (defvar -compare-fn nil - "Tests for equality use this function or `equal' if this is nil. -It should only be set using dynamic scope with a let, like: + "Tests for equality use this function, or `equal' if this is nil. - (let ((-compare-fn #\\='=)) (-union numbers1 numbers2 numbers3)") +As a dynamic variable, this should be temporarily bound around +the relevant operation, rather than permanently modified. For +example: + + (let ((-compare-fn #\\='=)) + (-union \\='(1 2 3) \\='(2 3 4)))") + +(defun dash--member-fn () + "Return the flavor of `member' that goes best with `-compare-fn'." + (declare (side-effect-free error-free)) + (let ((cmp -compare-fn)) + (cond ((memq cmp '(nil equal)) #'member) + ((eq cmp #'eq) #'memq) + ((eq cmp #'eql) #'memql) + ((lambda (elt list) + (while (and list (not (funcall cmp elt (car list)))) + (pop list)) + list))))) + +(defun dash--assoc-fn () + "Return the flavor of `assoc' that goes best with `-compare-fn'." + (declare (side-effect-free error-free)) + (let ((cmp -compare-fn)) + (cond ((memq cmp '(nil equal)) #'assoc) + ((eq cmp #'eq) #'assq) + ;; Since Emacs 26, `assoc' accepts a custom `testfn'. + ;; Version testing would be simpler here, but feature + ;; testing gets more brownie points, I guess. + ((condition-case nil + (with-no-warnings (assoc nil () #'eql)) + (wrong-number-of-arguments t)) + (lambda (key alist) + (--first (and (consp it) (funcall cmp (car it) key)) alist))) + ((with-no-warnings + (lambda (key alist) + (assoc key alist cmp))))))) + +(defun dash--hash-test-fn () + "Return the hash table test function corresponding to `-compare-fn'. +Return nil if `-compare-fn' is not a known test function." + (declare (side-effect-free error-free)) + ;; In theory this could also recognize values that are custom + ;; `hash-table-test's, but too often the :test name is different + ;; from the equality function, so it doesn't seem worthwile. + (car (memq (or -compare-fn #'equal) '(equal eq eql)))) + +(defvar dash--short-list-length 32 + "Maximum list length considered short, for optimizations. +For example, the speedup afforded by hash table lookup may start +to outweigh its runtime and memory overhead for problem sizes +greater than this value. See also the discussion in PR #305.") (defun -distinct (list) - "Return a new list with all duplicates removed. -The test for equality is done with `equal', -or with `-compare-fn' if that's non-nil. + "Return a copy of LIST with all duplicate elements removed. -Alias: `-uniq'" - ;; Implementation note: The speedup gained from hash table lookup - ;; starts to outweigh its overhead for lists of length greater than - ;; 32. See discussion in PR #305. - (let* ((len (length list)) - (lut (and (> len 32) - ;; Check that `-compare-fn' is a valid hash-table - ;; lookup function or nil. - (memq -compare-fn '(nil equal eq eql)) - (make-hash-table :test (or -compare-fn #'equal) - :size len)))) - (if lut - (--filter (unless (gethash it lut) - (puthash it t lut)) - list) - (--each list (unless (-contains? lut it) (!cons it lut))) - (nreverse lut)))) +The test for equality is done with `equal', or with `-compare-fn' +if that is non-nil. -(defalias '-uniq '-distinct) +Alias: `-uniq'." + (let (test len) + (cond ((null list) ()) + ;; Use a hash table if `-compare-fn' is a known hash table + ;; test function and the list is long enough. + ((and (setq test (dash--hash-test-fn)) + (> (setq len (length list)) dash--short-list-length)) + (let ((ht (make-hash-table :test test :size len))) + (--filter (unless (gethash it ht) (puthash it t ht)) list))) + ((let ((member (dash--member-fn)) uniq) + (--each list (unless (funcall member it uniq) (push it uniq))) + (nreverse uniq)))))) -(defun -union (list list2) - "Return a new list of all elements appearing in either LIST1 or LIST2. -Equality is defined by the value of `-compare-fn' if non-nil; -otherwise `equal'." - ;; We fall back to iteration implementation if the comparison - ;; function isn't one of `eq', `eql' or `equal'. - (let* ((result (reverse list)) - ;; TODO: get rid of this dynamic variable, pass it as an - ;; argument instead. - (-compare-fn (if (bound-and-true-p -compare-fn) - -compare-fn - 'equal))) - (if (memq -compare-fn '(eq eql equal)) - (let ((ht (make-hash-table :test -compare-fn))) - (--each list (puthash it t ht)) - (--each list2 (unless (gethash it ht) (!cons it result)))) - (--each list2 (unless (-contains? result it) (!cons it result)))) - (nreverse result))) +(defalias '-uniq #'-distinct) -(defun -intersection (list list2) - "Return a new list of the elements appearing in both LIST1 and LIST2. -Equality is defined by the value of `-compare-fn' if non-nil; -otherwise `equal'." - (--filter (-contains? list2 it) list)) +(defun dash--size+ (size1 size2) + "Return the sum of nonnegative fixnums SIZE1 and SIZE2. +Return `most-positive-fixnum' on overflow. This ensures the +result is a valid size, particularly for allocating hash tables, +even in the presence of bignum support." + (declare (side-effect-free t)) + (if (< size1 (- most-positive-fixnum size2)) + (+ size1 size2) + most-positive-fixnum)) -(defun -difference (list list2) - "Return a new list with only the members of LIST that are not in LIST2. -The test for equality is done with `equal', -or with `-compare-fn' if that's non-nil." - (--filter (not (-contains? list2 it)) list)) +(defun -union (list1 list2) + "Return a new list of distinct elements appearing in either LIST1 or LIST2. + +The test for equality is done with `equal', or with `-compare-fn' +if that is non-nil." + (let ((lists (list list1 list2)) test len union) + (cond ((null (or list1 list2))) + ;; Use a hash table if `-compare-fn' is a known hash table + ;; test function and the lists are long enough. + ((and (setq test (dash--hash-test-fn)) + (> (setq len (dash--size+ (length list1) (length list2))) + dash--short-list-length)) + (let ((ht (make-hash-table :test test :size len))) + (dolist (l lists) + (--each l (unless (gethash it ht) + (puthash it t ht) + (push it union)))))) + ((let ((member (dash--member-fn))) + (dolist (l lists) + (--each l (unless (funcall member it union) (push it union))))))) + (nreverse union))) + +(defun -intersection (list1 list2) + "Return a new list of distinct elements appearing in both LIST1 and LIST2. + +The test for equality is done with `equal', or with `-compare-fn' +if that is non-nil." + (let (test len) + (cond ((null (and list1 list2)) ()) + ;; Use a hash table if `-compare-fn' is a known hash table + ;; test function and either list is long enough. + ((and (setq test (dash--hash-test-fn)) + (> (setq len (length list2)) dash--short-list-length)) + (let ((ht (make-hash-table :test test :size len))) + (--each list2 (puthash it t ht)) + ;; Remove visited elements to avoid duplicates. + (--filter (when (gethash it ht) (remhash it ht) t) list1))) + ((let ((member (dash--member-fn)) intersection) + (--each list1 (and (funcall member it list2) + (not (funcall member it intersection)) + (push it intersection))) + (nreverse intersection)))))) + +(defun -difference (list1 list2) + "Return a new list with the distinct members of LIST1 that are not in LIST2. + +The test for equality is done with `equal', or with `-compare-fn' +if that is non-nil." + (let (test len1 len2) + (cond ((null list1) ()) + ((null list2) (-distinct list1)) + ;; Use a hash table if `-compare-fn' is a known hash table + ;; test function and the subtrahend is long enough. + ((and (setq test (dash--hash-test-fn)) + (setq len1 (length list1)) + (setq len2 (length list2)) + (> (max len1 len2) dash--short-list-length)) + (let ((ht1 (make-hash-table :test test :size len1)) + (ht2 (make-hash-table :test test :size len2))) + (--each list2 (puthash it t ht2)) + ;; Avoid duplicates by tracking visited items in `ht1'. + (--filter (unless (or (gethash it ht2) (gethash it ht1)) + (puthash it t ht1)) + list1))) + ((let ((member (dash--member-fn)) difference) + (--each list1 + (unless (or (funcall member it list2) + (funcall member it difference)) + (push it difference))) + (nreverse difference)))))) (defun -powerset (list) "Return the power set of LIST." - (if (null list) '(()) + (if (null list) (list ()) (let ((last (-powerset (cdr list)))) - (append (mapcar (lambda (x) (cons (car list) x)) last) - last)))) + (nconc (mapcar (lambda (x) (cons (car list) x)) last) + last)))) + +(defun -frequencies (list) + "Count the occurrences of each distinct element of LIST. + +Return an alist of (ELEMENT . N), where each ELEMENT occurs N +times in LIST. + +The test for equality is done with `equal', or with `-compare-fn' +if that is non-nil. + +See also `-count' and `-group-by'." + (let (test len freqs) + (cond ((null list)) + ((and (setq test (dash--hash-test-fn)) + (> (setq len (length list)) dash--short-list-length)) + (let ((ht (make-hash-table :test test :size len))) + ;; Share structure between hash table and returned list. + ;; This affords a single pass that preserves the input + ;; order, conses less garbage, and is faster than a + ;; second traversal (e.g., with `maphash'). + (--each list + (let ((freq (gethash it ht))) + (if freq + (setcdr freq (1+ (cdr freq))) + (push (puthash it (cons it 1) ht) freqs)))))) + ((let ((assoc (dash--assoc-fn))) + (--each list + (let ((freq (funcall assoc it freqs))) + (if freq + (setcdr freq (1+ (cdr freq))) + (push (cons it 1) freqs))))))) + (nreverse freqs))) + +(defun dash--numbers<= (nums) + "Return non-nil if NUMS is a list of non-decreasing numbers." + (declare (pure t) (side-effect-free t)) + (or (null nums) + (let ((prev (pop nums))) + (and (numberp prev) + (--every (and (numberp it) (<= prev (setq prev it))) nums))))) + +(defun dash--next-lex-perm (array n) + "Update ARRAY of N numbers with its next lexicographic permutation. +Return nil if there is no such successor. N should be nonzero. + +This implements the salient steps of Algorithm L (Lexicographic +permutation generation) as described in DE Knuth's The Art of +Computer Programming, Volume 4A / Combinatorial Algorithms, +Part I, Addison-Wesley, 2011, § 7.2.1.2, p. 319." + (setq n (1- n)) + (let* ((l n) + (j (1- n)) + (al (aref array n)) + (aj al)) + ;; L2. [Find j]. + ;; Decrement j until a[j] < a[j+1]. + (while (and (<= 0 j) + (<= aj (setq aj (aref array j)))) + (setq j (1- j))) + ;; Terminate algorithm if j not found. + (when (>= j 0) + ;; L3. [Increase a[j]]. + ;; Decrement l until a[j] < a[l]. + (while (>= aj al) + (setq l (1- l) al (aref array l))) + ;; Swap a[j] and a[l]. + (aset array j al) + (aset array l aj) + ;; L4. [Reverse a[j+1]...a[n]]. + (setq l n) + (while (< (setq j (1+ j)) l) + (setq aj (aref array j)) + (aset array j (aref array l)) + (aset array l aj) + (setq l (1- l))) + array))) + +(defun dash--lex-perms (vec &optional original) + "Return a list of permutations of VEC in lexicographic order. +Specifically, return only the successors of VEC in lexicographic +order. Each returned permutation is a list. VEC should comprise +one or more numbers, and may be destructively modified. + +If ORIGINAL is a vector, then VEC is interpreted as a set of +indices into ORIGINAL. In this case, the indices are permuted, +and the resulting index permutations are used to dereference +elements of ORIGINAL." + (let ((len (length vec)) perms) + (while vec + (push (if original + (--map (aref original it) vec) + (append vec ())) + perms) + (setq vec (dash--next-lex-perm vec len))) + (nreverse perms))) + +(defun dash--uniq-perms (list) + "Return a list of permutations of LIST. +LIST is treated as if all its elements are distinct." + (let* ((vec (vconcat list)) + (idxs (copy-sequence vec))) + ;; Just construct a vector of the list's indices and permute that. + (dotimes (i (length idxs)) + (aset idxs i i)) + (dash--lex-perms idxs vec))) + +(defun dash--multi-perms (list freqs) + "Return a list of permutations of the multiset LIST. +FREQS should be an alist describing the frequency of each element +in LIST, as returned by `-frequencies'." + (let (;; Distinct items in `list', aka the cars of `freqs'. + (uniq (make-vector (length freqs) nil)) + ;; Indices into `uniq'. + (idxs (make-vector (length list) nil)) + ;; Current index into `idxs'. + (i 0)) + (--each freqs + (aset uniq it-index (car it)) + ;; Populate `idxs' with as many copies of each `it-index' as + ;; there are corresponding duplicates. + (dotimes (_ (cdr it)) + (aset idxs i it-index) + (setq i (1+ i)))) + (dash--lex-perms idxs uniq))) (defun -permutations (list) - "Return the permutations of LIST." - (if (null list) '(()) - (apply #'append - (mapcar (lambda (x) - (mapcar (lambda (perm) (cons x perm)) - (-permutations (remove x list)))) - list)))) + "Return the distinct permutations of LIST. + +Duplicate elements of LIST are determined by `equal', or by +`-compare-fn' if that is non-nil." + (cond ((null list) (list ())) + ;; Optimization: a traversal of `list' is faster than the + ;; round trip via `dash--uniq-perms' or `dash--multi-perms'. + ((dash--numbers<= list) + (dash--lex-perms (vconcat list))) + ((let ((freqs (-frequencies list))) + ;; Is each element distinct? + (unless (--every (= (cdr it) 1) freqs) + (dash--multi-perms list freqs)))) + ((dash--uniq-perms list)))) (defun -inits (list) "Return all prefixes of LIST." @@ -2704,37 +3037,49 @@ or with `-compare-fn' if that's non-nil." "Return non-nil if LIST contains ELEMENT. The test for equality is done with `equal', or with `-compare-fn' -if that's non-nil. +if that is non-nil. As with `member', the return value is +actually the tail of LIST whose car is ELEMENT. -Alias: `-contains-p'" - (not - (null - (cond - ((null -compare-fn) (member element list)) - ((eq -compare-fn 'eq) (memq element list)) - ((eq -compare-fn 'eql) (memql element list)) - (t - (let ((lst list)) - (while (and lst - (not (funcall -compare-fn element (car lst)))) - (setq lst (cdr lst))) - lst)))))) +Alias: `-contains-p'." + (funcall (dash--member-fn) element list)) -(defalias '-contains-p '-contains?) +(defalias '-contains-p #'-contains?) -(defun -same-items? (list list2) - "Return true if LIST and LIST2 has the same items. +(defun -same-items? (list1 list2) + "Return non-nil if LIST1 and LIST2 have the same distinct elements. -The order of the elements in the lists does not matter. +The order of the elements in the lists does not matter. The +lists may be of different lengths, i.e., contain duplicate +elements. The test for equality is done with `equal', or with +`-compare-fn' if that is non-nil. -Alias: `-same-items-p'" - (let ((length-a (length list)) - (length-b (length list2))) - (and - (= length-a length-b) - (= length-a (length (-intersection list list2)))))) +Alias: `-same-items-p'." + (let (test len1 len2) + (cond ((null (or list1 list2))) + ((null (and list1 list2)) nil) + ;; Use a hash table if `-compare-fn' is a known hash table + ;; test function and either list is long enough. + ((and (setq test (dash--hash-test-fn)) + (setq len1 (length list1)) + (setq len2 (length list2)) + (> (max len1 len2) dash--short-list-length)) + (let ((ht1 (make-hash-table :test test :size len1)) + (ht2 (make-hash-table :test test :size len2))) + (--each list1 (puthash it t ht1)) + ;; Move visited elements from `ht1' to `ht2'. This way, + ;; if visiting all of `list2' leaves `ht1' empty, then + ;; all elements from both lists have been accounted for. + (and (--every (cond ((gethash it ht1) + (remhash it ht1) + (puthash it t ht2)) + ((gethash it ht2))) + list2) + (zerop (hash-table-count ht1))))) + ((let ((member (dash--member-fn))) + (and (--all? (funcall member it list2) list1) + (--all? (funcall member it list1) list2))))))) -(defalias '-same-items-p '-same-items?) +(defalias '-same-items-p #'-same-items?) (defun -is-prefix? (prefix list) "Return non-nil if PREFIX is a prefix of LIST. @@ -2779,7 +3124,7 @@ if the first element should sort before the second." (defmacro --sort (form list) "Anaphoric form of `-sort'." (declare (debug (def-form form))) - `(-sort (lambda (it other) ,form) ,list)) + `(-sort (lambda (it other) (ignore it other) ,form) ,list)) (defun -list (&optional arg &rest args) "Ensure ARG is a list. @@ -2791,14 +3136,14 @@ In this case, if ARG is not a list, a new list with all of ARGS as elements is returned. This use is supported for backward compatibility and is otherwise deprecated." (declare (advertised-calling-convention (arg) "2.18.0") - (pure t) (side-effect-free t)) + (pure t) (side-effect-free error-free)) (if (listp arg) arg (cons arg args))) (defun -repeat (n x) "Return a new list of length N with each element being X. Return nil if N is less than 1." (declare (pure t) (side-effect-free t)) - (and (natnump n) (make-list n x))) + (and (>= n 0) (make-list n x))) (defun -sum (list) "Return the sum of LIST." @@ -2855,14 +3200,14 @@ comparing them." The items for the comparator form are exposed as \"it\" and \"other\"." (declare (debug (def-form form))) - `(-max-by (lambda (it other) ,form) ,list)) + `(-max-by (lambda (it other) (ignore it other) ,form) ,list)) (defmacro --min-by (form list) "Anaphoric version of `-min-by'. The items for the comparator form are exposed as \"it\" and \"other\"." (declare (debug (def-form form))) - `(-min-by (lambda (it other) ,form) ,list)) + `(-min-by (lambda (it other) (ignore it other) ,form) ,list)) (defun -iota (count &optional start step) "Return a list containing COUNT numbers. @@ -2892,7 +3237,7 @@ FN is called at least once, results are compared with `equal'." (defmacro --fix (form list) "Anaphoric form of `-fix'." (declare (debug (def-form form))) - `(-fix (lambda (it) ,form) ,list)) + `(-fix (lambda (it) (ignore it) ,form) ,list)) (defun -unfold (fun seed) "Build a list from SEED using FUN. @@ -2913,14 +3258,14 @@ the new seed." (defmacro --unfold (form seed) "Anaphoric version of `-unfold'." (declare (debug (def-form form))) - `(-unfold (lambda (it) ,form) ,seed)) + `(-unfold (lambda (it) (ignore it) ,form) ,seed)) (defun -cons-pair? (obj) "Return non-nil if OBJ is a true cons pair. That is, a cons (A . B) where B is not a list. Alias: `-cons-pair-p'." - (declare (pure t) (side-effect-free t)) + (declare (pure t) (side-effect-free error-free)) (nlistp (cdr-safe obj))) (defalias '-cons-pair-p '-cons-pair?) @@ -2938,9 +3283,7 @@ and `cdr' of the pair respectively. If the value is anything else, wrap it in a list." (declare (pure t) (side-effect-free t)) - (cond - ((-cons-pair? val) (-cons-to-list val)) - (t (list val)))) + (if (-cons-pair? val) (-cons-to-list val) (list val))) (defun -tree-mapreduce-from (fn folder init-value tree) "Apply FN to each element of TREE, and make a list of the results. @@ -2953,16 +3296,21 @@ INIT-VALUE. See `-reduce-r-from'. This is the same as calling `-tree-reduce-from' after `-tree-map' but is twice as fast as it only traverse the structure once." (cond - ((not tree) nil) + ((null tree) ()) ((-cons-pair? tree) (funcall fn tree)) - ((listp tree) - (-reduce-r-from folder init-value (mapcar (lambda (x) (-tree-mapreduce-from fn folder init-value x)) tree))) - (t (funcall fn tree)))) + ((consp tree) + (-reduce-r-from + folder init-value + (mapcar (lambda (x) (-tree-mapreduce-from fn folder init-value x)) tree))) + ((funcall fn tree)))) (defmacro --tree-mapreduce-from (form folder init-value tree) "Anaphoric form of `-tree-mapreduce-from'." (declare (debug (def-form def-form form form))) - `(-tree-mapreduce-from (lambda (it) ,form) (lambda (it acc) ,folder) ,init-value ,tree)) + `(-tree-mapreduce-from (lambda (it) (ignore it) ,form) + (lambda (it acc) (ignore it acc) ,folder) + ,init-value + ,tree)) (defun -tree-mapreduce (fn folder tree) "Apply FN to each element of TREE, and make a list of the results. @@ -2975,30 +3323,32 @@ INIT-VALUE. See `-reduce-r-from'. This is the same as calling `-tree-reduce' after `-tree-map' but is twice as fast as it only traverse the structure once." (cond - ((not tree) nil) + ((null tree) ()) ((-cons-pair? tree) (funcall fn tree)) - ((listp tree) + ((consp tree) (-reduce-r folder (mapcar (lambda (x) (-tree-mapreduce fn folder x)) tree))) - (t (funcall fn tree)))) + ((funcall fn tree)))) (defmacro --tree-mapreduce (form folder tree) "Anaphoric form of `-tree-mapreduce'." (declare (debug (def-form def-form form))) - `(-tree-mapreduce (lambda (it) ,form) (lambda (it acc) ,folder) ,tree)) + `(-tree-mapreduce (lambda (it) (ignore it) ,form) + (lambda (it acc) (ignore it acc) ,folder) + ,tree)) (defun -tree-map (fn tree) "Apply FN to each element of TREE while preserving the tree structure." (cond - ((not tree) nil) + ((null tree) ()) ((-cons-pair? tree) (funcall fn tree)) - ((listp tree) + ((consp tree) (mapcar (lambda (x) (-tree-map fn x)) tree)) - (t (funcall fn tree)))) + ((funcall fn tree)))) (defmacro --tree-map (form tree) "Anaphoric form of `-tree-map'." (declare (debug (def-form form))) - `(-tree-map (lambda (it) ,form) ,tree)) + `(-tree-map (lambda (it) (ignore it) ,form) ,tree)) (defun -tree-reduce-from (fn init-value tree) "Use FN to reduce elements of list TREE. @@ -3010,16 +3360,19 @@ then on this result and second element from the list etc. The initial value is ignored on cons pairs as they always contain two elements." (cond - ((not tree) nil) + ((null tree) ()) ((-cons-pair? tree) tree) - ((listp tree) - (-reduce-r-from fn init-value (mapcar (lambda (x) (-tree-reduce-from fn init-value x)) tree))) - (t tree))) + ((consp tree) + (-reduce-r-from + fn init-value + (mapcar (lambda (x) (-tree-reduce-from fn init-value x)) tree))) + (tree))) (defmacro --tree-reduce-from (form init-value tree) "Anaphoric form of `-tree-reduce-from'." (declare (debug (def-form form form))) - `(-tree-reduce-from (lambda (it acc) ,form) ,init-value ,tree)) + `(-tree-reduce-from (lambda (it acc) (ignore it acc) ,form) + ,init-value ,tree)) (defun -tree-reduce (fn tree) "Use FN to reduce elements of list TREE. @@ -3030,16 +3383,16 @@ element, then on this result and third element from the list etc. See `-reduce-r' for how exactly are lists of zero or one element handled." (cond - ((not tree) nil) + ((null tree) ()) ((-cons-pair? tree) tree) - ((listp tree) + ((consp tree) (-reduce-r fn (mapcar (lambda (x) (-tree-reduce fn x)) tree))) - (t tree))) + (tree))) (defmacro --tree-reduce (form tree) "Anaphoric form of `-tree-reduce'." (declare (debug (def-form form))) - `(-tree-reduce (lambda (it acc) ,form) ,tree)) + `(-tree-reduce (lambda (it acc) (ignore it acc) ,form) ,tree)) (defun -tree-map-nodes (pred fun tree) "Call FUN on each node of TREE that satisfies PRED. @@ -3047,17 +3400,17 @@ See `-reduce-r' for how exactly are lists of zero or one element handled." If PRED returns nil, continue descending down this node. If PRED returns non-nil, apply FUN to this node and do not descend further." - (if (funcall pred tree) - (funcall fun tree) - (if (and (listp tree) - (not (-cons-pair? tree))) - (-map (lambda (x) (-tree-map-nodes pred fun x)) tree) - tree))) + (cond ((funcall pred tree) (funcall fun tree)) + ((and (listp tree) (listp (cdr tree))) + (-map (lambda (x) (-tree-map-nodes pred fun x)) tree)) + (tree))) (defmacro --tree-map-nodes (pred form tree) "Anaphoric form of `-tree-map-nodes'." (declare (debug (def-form def-form form))) - `(-tree-map-nodes (lambda (it) ,pred) (lambda (it) ,form) ,tree)) + `(-tree-map-nodes (lambda (it) (ignore it) ,pred) + (lambda (it) (ignore it) ,form) + ,tree)) (defun -tree-seq (branch children tree) "Return a sequence of the nodes in TREE, in depth-first search order. @@ -3070,14 +3423,16 @@ of the passed branch node. Non-branch nodes are simply copied." (cons tree - (when (funcall branch tree) - (-mapcat (lambda (x) (-tree-seq branch children x)) - (funcall children tree))))) + (and (funcall branch tree) + (-mapcat (lambda (x) (-tree-seq branch children x)) + (funcall children tree))))) (defmacro --tree-seq (branch children tree) "Anaphoric form of `-tree-seq'." (declare (debug (def-form def-form form))) - `(-tree-seq (lambda (it) ,branch) (lambda (it) ,children) ,tree)) + `(-tree-seq (lambda (it) (ignore it) ,branch) + (lambda (it) (ignore it) ,children) + ,tree)) (defun -clone (list) "Create a deep copy of LIST. @@ -3085,7 +3440,7 @@ The new list has the same elements and structure but all cons are replaced with new ones. This is useful when you need to clone a structure such as plist or alist." (declare (pure t) (side-effect-free t)) - (-tree-map 'identity list)) + (-tree-map #'identity list)) ;;; Combinators @@ -3098,14 +3453,14 @@ is a new function which does the same as FN, except that the last N arguments are fixed at the values with which this function was called. This is like `-partial', except the arguments are fixed starting from the right rather than the left." - (declare (pure t) (side-effect-free t)) + (declare (pure t) (side-effect-free error-free)) (lambda (&rest args-before) (apply fn (append args-before args)))) (defun -juxt (&rest fns) "Return a function that is the juxtaposition of FNS. The returned function takes a variable number of ARGS, applies each of FNS in turn to ARGS, and returns the list of results." - (declare (pure t) (side-effect-free t)) + (declare (pure t) (side-effect-free error-free)) (lambda (&rest args) (mapcar (lambda (x) (apply x args)) fns))) (defun -compose (&rest fns) @@ -3115,7 +3470,7 @@ the last function in FNS to ARGS, and returns the result of calling each remaining function on the result of the previous function, right-to-left. If no FNS are given, return a variadic `identity' function." - (declare (pure t) (side-effect-free t)) + (declare (pure t) (side-effect-free error-free)) (let* ((fns (nreverse fns)) (head (car fns)) (tail (cdr fns))) @@ -3129,7 +3484,7 @@ function, right-to-left. If no FNS are given, return a variadic "Return a function that applies FN to a single list of args. This changes the arity of FN from taking N distinct arguments to taking 1 argument which is a list of N arguments." - (declare (pure t) (side-effect-free t)) + (declare (pure t) (side-effect-free error-free)) (lambda (args) (apply fn args))) (defun -on (op trans) @@ -3143,7 +3498,7 @@ equivalent: (funcall (-on #\\='+ #\\='1+) 1 2 3) = (+ (1+ 1) (1+ 2) (1+ 3)) (funcall (-on #\\='+ #\\='1+)) = (+)" - (declare (pure t) (side-effect-free t)) + (declare (pure t) (side-effect-free error-free)) (lambda (&rest args) ;; This unrolling seems to be a relatively cheap way to keep the ;; overhead of `mapcar' + `apply' in check. @@ -3165,7 +3520,7 @@ equivalent: (funcall (-flip #\\='-) 1 2) = (- 2 1) See also: `-rotate-args'." - (declare (pure t) (side-effect-free t)) + (declare (pure t) (side-effect-free error-free)) (lambda (&rest args) ;; Open-code for speed. (cond ((cddr args) (apply fn (nreverse args))) ((cdr args) (funcall fn (cadr args) (car args))) @@ -3198,7 +3553,7 @@ See also: `-flip'." "Return a function that returns C ignoring any additional arguments. In types: a -> b -> a" - (declare (pure t) (side-effect-free t)) + (declare (pure t) (side-effect-free error-free)) (lambda (&rest _) c)) (defmacro -cut (&rest params) @@ -3224,7 +3579,7 @@ The returned predicate passes its arguments to PRED. If PRED returns nil, the result is non-nil; otherwise the result is nil. See also: `-andfn' and `-orfn'." - (declare (pure t) (side-effect-free t)) + (declare (pure t) (side-effect-free error-free)) (lambda (&rest args) (not (apply pred args)))) (defun -orfn (&rest preds) @@ -3236,7 +3591,7 @@ the remaining PREDS. If all PREDS return nil, or if no PREDS are given, the returned predicate returns nil. See also: `-andfn' and `-not'." - (declare (pure t) (side-effect-free t)) + (declare (pure t) (side-effect-free error-free)) ;; Open-code for speed. (cond ((cdr preds) (lambda (&rest args) (--some (apply it args) preds))) (preds (car preds)) @@ -3251,7 +3606,7 @@ remaining PREDS. If all PREDS return non-nil, P returns the last such value. If no PREDS are given, P always returns non-nil. See also: `-orfn' and `-not'." - (declare (pure t) (side-effect-free t)) + (declare (pure t) (side-effect-free error-free)) ;; Open-code for speed. (cond ((cdr preds) (lambda (&rest args) (--every (apply it args) preds))) (preds (car preds)) diff --git a/elpa/dash-20220417.2250/dash.info b/elpa/dash-20220608.1931/dash.info similarity index 93% rename from elpa/dash-20220417.2250/dash.info rename to elpa/dash-20220608.1931/dash.info index 2741464..c19b136 100644 --- a/elpa/dash-20220417.2250/dash.info +++ b/elpa/dash-20220608.1931/dash.info @@ -288,35 +288,45 @@ The results are collected in order and returned as a new list. ⇒ (0 2 6 12) -- Function: -annotate (fn list) - Return a list of cons cells where each cell is FN applied to each - element of LIST paired with the unmodified element of LIST. + Pair each item in LIST with the result of passing it to FN. - (-annotate '1+ '(1 2 3)) + Return an alist of (RESULT . ITEM), where each ITEM is the + corresponding element of LIST, and RESULT is the value obtained by + calling FN on ITEM. + + This function’s anaphoric counterpart is ‘--annotate’. + + (-annotate #'1+ '(1 2 3)) ⇒ ((2 . 1) (3 . 2) (4 . 3)) - (-annotate 'length '(("h" "e" "l" "l" "o") ("hello" "world"))) - ⇒ ((5 "h" "e" "l" "l" "o") (2 "hello" "world")) - (--annotate (< 1 it) '(0 1 2 3)) + (-annotate #'length '((f o o) (bar baz))) + ⇒ ((3 f o o) (2 bar baz)) + (--annotate (> it 1) '(0 1 2 3)) ⇒ ((nil . 0) (nil . 1) (t . 2) (t . 3)) -- Function: -splice (pred fun list) - Splice lists generated by FUN in place of elements matching PRED in + Splice lists generated by FUN in place of items satisfying PRED in LIST. - FUN takes the element matching PRED as input. + Call PRED on each element of LIST. Whenever the result of PRED is + ‘nil’, leave that ‘it’ as-is. Otherwise, call FUN on the same ‘it’ + that satisfied PRED. The result should be a (possibly empty) list + of items to splice in place of ‘it’ in LIST. - This function can be used as replacement for ‘,@’ in case you need - to splice several lists at marked positions (for example with - keywords). + This can be useful as an alternative to the ‘,@’ construct in a ‘`’ + structure, in case you need to splice several lists at marked + positions (for example with keywords). + + This function’s anaphoric counterpart is ‘--splice’. See also: ‘-splice-list’ (*note -splice-list::), ‘-insert-at’ - (*note -insert-at::) + (*note -insert-at::). - (-splice 'even? (lambda (x) (list x x)) '(1 2 3 4)) - ⇒ (1 2 2 3 4 4) - (--splice 't (list it it) '(1 2 3 4)) + (-splice #'numberp (lambda (n) (list n n)) '(a 1 b 2)) + ⇒ (a 1 1 b 2 2) + (--splice t (list it it) '(1 2 3 4)) ⇒ (1 1 2 2 3 3 4 4) - (--splice (equal it :magic) '((list of) (magical) (code)) '((foo) (bar) :magic (baz))) - ⇒ ((foo) (bar) (list of) (magical) (code) (baz)) + (--splice (eq it :magic) '((magical) (code)) '((foo) :magic (bar))) + ⇒ ((foo) (magical) (code) (bar)) -- Function: -splice-list (pred new-list list) Splice NEW-LIST in place of elements matching PRED in LIST. @@ -1091,6 +1101,25 @@ Functions reducing lists to a single value (which may also be a list). (--max-by (> (length it) (length other)) '((1 2 3) (2) (3 2))) ⇒ (1 2 3) + -- Function: -frequencies (list) + Count the occurrences of each distinct element of LIST. + + Return an alist of (ELEMENT . N), where each ELEMENT occurs N + times in LIST. + + The test for equality is done with ‘equal’, or with ‘-compare-fn’ + if that is non-‘nil’. + + See also ‘-count’ (*note -count::) and ‘-group-by’ (*note + -group-by::). + + (-frequencies ()) + ⇒ () + (-frequencies '(1 2 3 1 2 1)) + ⇒ ((1 . 3) (2 . 2) (3 . 1)) + (let ((-compare-fn #'string=)) (-frequencies '(a "a"))) + ⇒ ((a . 2)) +  File: dash.info, Node: Unfolding, Next: Predicates, Prev: Reductions, Up: Functions @@ -1135,6 +1164,28 @@ than consuming a list to produce a single value. (--unfold (when it (cons it (butlast it))) '(1 2 3 4)) ⇒ ((1 2 3 4) (1 2 3) (1 2) (1)) + -- Function: -repeat (n x) + Return a new list of length N with each element being X. Return + ‘nil’ if N is less than 1. + + (-repeat 3 :a) + ⇒ (:a :a :a) + (-repeat 1 :a) + ⇒ (:a) + (-repeat 0 :a) + ⇒ () + + -- Function: -cycle (list) + Return an infinite circular copy of LIST. The returned list cycles + through the elements of LIST and repeats from the beginning. + + (-take 5 (-cycle '(1 2 3))) + ⇒ (1 2 3 1 2) + (-take 7 (-cycle '(1 "and" 3))) + ⇒ (1 "and" 3 1 "and" 3 1) + (-zip (-cycle '(1 2 3)) '(1 2)) + ⇒ ((1 . 1) (2 . 2)) +  File: dash.info, Node: Predicates, Next: Partitioning, Prev: Unfolding, Up: Functions @@ -1239,30 +1290,17 @@ Reductions of one or more lists to a boolean value. Return non-‘nil’ if LIST contains ELEMENT. The test for equality is done with ‘equal’, or with ‘-compare-fn’ - if that’s non-‘nil’. + if that is non-‘nil’. As with ‘member’, the return value is + actually the tail of LIST whose car is ELEMENT. - Alias: ‘-contains-p’ + Alias: ‘-contains-p’. (-contains? '(1 2 3) 1) - ⇒ t + ⇒ (1 2 3) (-contains? '(1 2 3) 2) - ⇒ t + ⇒ (2 3) (-contains? '(1 2 3) 4) - ⇒ nil - - -- Function: -same-items? (list list2) - Return true if LIST and LIST2 has the same items. - - The order of the elements in the lists does not matter. - - Alias: ‘-same-items-p’ - - (-same-items? '(1 2 3) '(1 2 3)) - ⇒ t - (-same-items? '(1 2 3) '(3 2 1)) - ⇒ t - (-same-items? '(1 2 3) '(1 2 3 4)) - ⇒ nil + ⇒ () -- Function: -is-prefix? (prefix list) Return non-‘nil’ if PREFIX is a prefix of LIST. @@ -1541,66 +1579,88 @@ Functions retrieving or sorting based on list indices and related predicates. -- Function: -elem-index (elem list) - Return the index of the first element in the given LIST which is - equal to the query element ELEM, or ‘nil’ if there is no such - element. + Return the first index of ELEM in LIST. That is, the index within + LIST of the first element that is ‘equal’ to ELEM. Return ‘nil’ if + there is no such element. - (-elem-index 2 '(6 7 8 2 3 4)) - ⇒ 3 + See also: ‘-find-index’ (*note -find-index::). + + (-elem-index 2 '(6 7 8 3 4)) + ⇒ nil (-elem-index "bar" '("foo" "bar" "baz")) ⇒ 1 (-elem-index '(1 2) '((3) (5 6) (1 2) nil)) ⇒ 2 -- Function: -elem-indices (elem list) - Return the indices of all elements in LIST equal to the query - element ELEM, in ascending order. + Return the list of indices at which ELEM appears in LIST. That is, + the indices of all elements of LIST ‘equal’ to ELEM, in the same + ascending order as they appear in LIST. - (-elem-indices 2 '(6 7 8 2 3 4 2 1)) - ⇒ (3 6) + (-elem-indices 2 '(6 7 8 3 4 1)) + ⇒ () (-elem-indices "bar" '("foo" "bar" "baz")) ⇒ (1) (-elem-indices '(1 2) '((3) (1 2) (5 6) (1 2) nil)) ⇒ (1 3) -- Function: -find-index (pred list) - Take a predicate PRED and a LIST and return the index of the first - element in the list satisfying the predicate, or ‘nil’ if there is - no such element. + Return the index of the first item satisfying PRED in LIST. Return + ‘nil’ if no such item is found. - See also ‘-first’ (*note -first::). + PRED is called with one argument, the current list element, until + it returns non-‘nil’, at which point the search terminates. - (-find-index 'even? '(2 4 1 6 3 3 5 8)) + This function’s anaphoric counterpart is ‘--find-index’. + + See also: ‘-first’ (*note -first::), ‘-find-last-index’ (*note + -find-last-index::). + + (-find-index #'numberp '(a b c)) + ⇒ nil + (-find-index #'natnump '(1 0 -1)) ⇒ 0 - (--find-index (< 5 it) '(2 4 1 6 3 3 5 8)) + (--find-index (> it 5) '(2 4 1 6 3 3 5 8)) ⇒ 3 - (-find-index (-partial 'string-lessp "baz") '("bar" "foo" "baz")) - ⇒ 1 -- Function: -find-last-index (pred list) - Take a predicate PRED and a LIST and return the index of the last - element in the list satisfying the predicate, or ‘nil’ if there is - no such element. + Return the index of the last item satisfying PRED in LIST. Return + ‘nil’ if no such item is found. - See also ‘-last’ (*note -last::). + Predicate PRED is called with one argument each time, namely the + current list element. - (-find-last-index 'even? '(2 4 1 6 3 3 5 8)) - ⇒ 7 - (--find-last-index (< 5 it) '(2 7 1 6 3 8 5 2)) + This function’s anaphoric counterpart is ‘--find-last-index’. + + See also: ‘-last’ (*note -last::), ‘-find-index’ (*note + -find-index::). + + (-find-last-index #'numberp '(a b c)) + ⇒ nil + (--find-last-index (> it 5) '(2 7 1 6 3 8 5 2)) ⇒ 5 - (-find-last-index (-partial 'string-lessp "baz") '("q" "foo" "baz")) + (-find-last-index (-partial #'string< 'a) '(c b a)) ⇒ 1 -- Function: -find-indices (pred list) - Return the indices of all elements in LIST satisfying the predicate - PRED, in ascending order. + Return the list of indices in LIST satisfying PRED. - (-find-indices 'even? '(2 4 1 6 3 3 5 8)) + Each element of LIST in turn is passed to PRED. If the result is + non-‘nil’, the index of that element in LIST is included in the + result. The returned indices are in ascending order, i.e., in the + same order as they appear in LIST. + + This function’s anaphoric counterpart is ‘--find-indices’. + + See also: ‘-find-index’ (*note -find-index::), ‘-elem-indices’ + (*note -elem-indices::). + + (-find-indices #'numberp '(a b c)) + ⇒ () + (-find-indices #'numberp '(8 1 d 2 b c a 3)) ⇒ (0 1 3 7) - (--find-indices (< 5 it) '(2 4 1 6 3 3 5 8)) + (--find-indices (> it 5) '(2 4 1 6 3 3 5 8)) ⇒ (3 7) - (-find-indices (-partial 'string-lessp "baz") '("bar" "foo" "baz")) - ⇒ (1) -- Function: -grade-up (comparator list) Grade elements of LIST using COMPARATOR relation. This yields a @@ -1630,22 +1690,26 @@ File: dash.info, Node: Set operations, Next: Other list operations, Prev: Ind Operations pretending lists are sets. - -- Function: -union (list list2) - Return a new list of all elements appearing in either LIST1 or - LIST2. Equality is defined by the value of ‘-compare-fn’ if - non-‘nil’; otherwise ‘equal’. + -- Function: -union (list1 list2) + Return a new list of distinct elements appearing in either LIST1 or + LIST2. + + The test for equality is done with ‘equal’, or with ‘-compare-fn’ + if that is non-‘nil’. (-union '(1 2 3) '(3 4 5)) ⇒ (1 2 3 4 5) - (-union '(1 2 3 4) ()) - ⇒ (1 2 3 4) - (-union '(1 1 2 2) '(3 2 1)) - ⇒ (1 1 2 2 3) + (-union '(1 2 2 4) ()) + ⇒ (1 2 4) + (-union '(1 1 2 2) '(4 4 3 2 1)) + ⇒ (1 2 4 3) - -- Function: -difference (list list2) - Return a new list with only the members of LIST that are not in - LIST2. The test for equality is done with ‘equal’, or with - ‘-compare-fn’ if that’s non-‘nil’. + -- Function: -difference (list1 list2) + Return a new list with the distinct members of LIST1 that are not + in LIST2. + + The test for equality is done with ‘equal’, or with ‘-compare-fn’ + if that is non-‘nil’. (-difference () ()) ⇒ () @@ -1654,50 +1718,76 @@ Operations pretending lists are sets. (-difference '(1 2 3 4) '(3 4 5 6)) ⇒ (1 2) - -- Function: -intersection (list list2) - Return a new list of the elements appearing in both LIST1 and - LIST2. Equality is defined by the value of ‘-compare-fn’ if - non-‘nil’; otherwise ‘equal’. + -- Function: -intersection (list1 list2) + Return a new list of distinct elements appearing in both LIST1 and + LIST2. + + The test for equality is done with ‘equal’, or with ‘-compare-fn’ + if that is non-‘nil’. (-intersection () ()) ⇒ () (-intersection '(1 2 3) '(4 5 6)) ⇒ () - (-intersection '(1 2 3 4) '(3 4 5 6)) - ⇒ (3 4) + (-intersection '(1 2 2 3) '(4 3 3 2)) + ⇒ (2 3) -- Function: -powerset (list) Return the power set of LIST. (-powerset ()) ⇒ (nil) + (-powerset '(x y)) + ⇒ ((x y) (x) (y) nil) (-powerset '(x y z)) ⇒ ((x y z) (x y) (x z) (x) (y z) (y) (z) nil) -- Function: -permutations (list) - Return the permutations of LIST. + Return the distinct permutations of LIST. + + Duplicate elements of LIST are determined by ‘equal’, or by + ‘-compare-fn’ if that is non-‘nil’. (-permutations ()) ⇒ (nil) - (-permutations '(1 2)) - ⇒ ((1 2) (2 1)) + (-permutations '(a a b)) + ⇒ ((a a b) (a b a) (b a a)) (-permutations '(a b c)) ⇒ ((a b c) (a c b) (b a c) (b c a) (c a b) (c b a)) -- Function: -distinct (list) - Return a new list with all duplicates removed. The test for - equality is done with ‘equal’, or with ‘-compare-fn’ if that’s - non-‘nil’. + Return a copy of LIST with all duplicate elements removed. - Alias: ‘-uniq’ + The test for equality is done with ‘equal’, or with ‘-compare-fn’ + if that is non-‘nil’. + + Alias: ‘-uniq’. (-distinct ()) ⇒ () - (-distinct '(1 2 2 4)) - ⇒ (1 2 4) + (-distinct '(1 1 2 3 3)) + ⇒ (1 2 3) (-distinct '(t t t)) ⇒ (t) + -- Function: -same-items? (list1 list2) + Return non-‘nil’ if LIST1 and LIST2 have the same distinct + elements. + + The order of the elements in the lists does not matter. The lists + may be of different lengths, i.e., contain duplicate elements. The + test for equality is done with ‘equal’, or with ‘-compare-fn’ if + that is non-‘nil’. + + Alias: ‘-same-items-p’. + + (-same-items? '(1 2 3) '(1 2 3)) + ⇒ t + (-same-items? '(1 1 2 3) '(3 3 2 1)) + ⇒ t + (-same-items? '(1 2 3) '(1 2 3 4)) + ⇒ nil +  File: dash.info, Node: Other list operations, Next: Tree operations, Prev: Set operations, Up: Functions @@ -1717,17 +1807,6 @@ Other list functions not fit to be classified elsewhere. (-rotate 16 '(1 2 3 4 5 6 7)) ⇒ (6 7 1 2 3 4 5) - -- Function: -repeat (n x) - Return a new list of length N with each element being X. Return - ‘nil’ if N is less than 1. - - (-repeat 3 :a) - ⇒ (:a :a :a) - (-repeat 1 :a) - ⇒ (:a) - (-repeat 0 :a) - ⇒ nil - -- Function: -cons* (&rest args) Make a new list from the elements of ARGS. The last 2 elements of ARGS are used as the final cons of the result, so if the final @@ -1878,27 +1957,20 @@ Other list functions not fit to be classified elsewhere. (-unzip '((1 2) (3 4))) ⇒ ((1 . 3) (2 . 4)) - -- Function: -cycle (list) - Return an infinite circular copy of LIST. The returned list cycles - through the elements of LIST and repeats from the beginning. - - (-take 5 (-cycle '(1 2 3))) - ⇒ (1 2 3 1 2) - (-take 7 (-cycle '(1 "and" 3))) - ⇒ (1 "and" 3 1 "and" 3 1) - (-zip (-cycle '(1 2 3)) '(1 2)) - ⇒ ((1 . 1) (2 . 2)) - -- Function: -pad (fill-value &rest lists) - Appends FILL-VALUE to the end of each list in LISTS such that they - will all have the same length. + Pad each of LISTS with FILL-VALUE until they all have equal + lengths. + + Ensure all LISTS are as long as the longest one by repeatedly + appending FILL-VALUE to the shorter lists, and return the resulting + LISTS. (-pad 0 ()) ⇒ (nil) - (-pad 0 '(1)) - ⇒ ((1)) - (-pad 0 '(1 2 3) '(4 5)) - ⇒ ((1 2 3) (4 5 0)) + (-pad 0 '(1 2) '(3 4)) + ⇒ ((1 2) (3 4)) + (-pad 0 '(1 2) '(3 4 5 6) '(7 8 9)) + ⇒ ((1 2 0 0) (3 4 5 6) (7 8 9 0)) -- Function: -table (fn &rest lists) Compute outer product of LISTS using function FN. @@ -1946,8 +2018,10 @@ Other list functions not fit to be classified elsewhere. -- Function: -first (pred list) Return the first item in LIST for which PRED returns non-‘nil’. - Return ‘nil’ if no such element is found. To get the first item in - the list no questions asked, use ‘car’. + Return ‘nil’ if no such element is found. + + To get the first item in the list no questions asked, use + ‘-first-item’ (*note -first-item::). Alias: ‘-find’. @@ -1974,62 +2048,76 @@ Other list functions not fit to be classified elsewhere. Return the first item of LIST, or ‘nil’ on an empty list. See also: ‘-second-item’ (*note -second-item::), ‘-last-item’ - (*note -last-item::). + (*note -last-item::), etc. - (-first-item '(1 2 3)) + (-first-item ()) + ⇒ () + (-first-item '(1 2 3 4 5)) ⇒ 1 - (-first-item nil) - ⇒ nil (let ((list (list 1 2 3))) (setf (-first-item list) 5) list) ⇒ (5 2 3) -- Function: -second-item (list) Return the second item of LIST, or ‘nil’ if LIST is too short. - See also: ‘-third-item’ (*note -third-item::). + See also: ‘-first-item’ (*note -first-item::), ‘-third-item’ (*note + -third-item::), etc. - (-second-item '(1 2 3)) + (-second-item ()) + ⇒ () + (-second-item '(1 2 3 4 5)) ⇒ 2 - (-second-item nil) - ⇒ nil + (let ((list (list 1 2))) (setf (-second-item list) 5) list) + ⇒ (1 5) -- Function: -third-item (list) Return the third item of LIST, or ‘nil’ if LIST is too short. - See also: ‘-fourth-item’ (*note -fourth-item::). + See also: ‘-second-item’ (*note -second-item::), ‘-fourth-item’ + (*note -fourth-item::), etc. - (-third-item '(1 2 3)) + (-third-item ()) + ⇒ () + (-third-item '(1 2)) + ⇒ () + (-third-item '(1 2 3 4 5)) ⇒ 3 - (-third-item nil) - ⇒ nil -- Function: -fourth-item (list) Return the fourth item of LIST, or ‘nil’ if LIST is too short. - See also: ‘-fifth-item’ (*note -fifth-item::). + See also: ‘-third-item’ (*note -third-item::), ‘-fifth-item’ (*note + -fifth-item::), etc. - (-fourth-item '(1 2 3 4)) + (-fourth-item ()) + ⇒ () + (-fourth-item '(1 2 3)) + ⇒ () + (-fourth-item '(1 2 3 4 5)) ⇒ 4 - (-fourth-item nil) - ⇒ nil -- Function: -fifth-item (list) Return the fifth item of LIST, or ‘nil’ if LIST is too short. - See also: ‘-last-item’ (*note -last-item::). + See also: ‘-fourth-item’ (*note -fourth-item::), ‘-last-item’ + (*note -last-item::), etc. + (-fifth-item ()) + ⇒ () + (-fifth-item '(1 2 3 4)) + ⇒ () (-fifth-item '(1 2 3 4 5)) ⇒ 5 - (-fifth-item nil) - ⇒ nil -- Function: -last-item (list) Return the last item of LIST, or ‘nil’ on an empty list. - (-last-item '(1 2 3)) - ⇒ 3 - (-last-item nil) - ⇒ nil + See also: ‘-first-item’ (*note -first-item::), etc. + + (-last-item ()) + ⇒ () + (-last-item '(1 2 3 4 5)) + ⇒ 5 (let ((list (list 1 2 3))) (setf (-last-item list) 5) list) ⇒ (1 2 5) @@ -4334,7 +4422,7 @@ Index (line 63) * -as->: Threading macros. (line 49) * -butlast: Other list operations. - (line 335) + (line 333) * -clone: Tree operations. (line 123) * -common-prefix: Reductions. (line 242) * -common-suffix: Reductions. (line 252) @@ -4342,19 +4430,18 @@ Index (line 49) * -concat: List to list. (line 23) * -cons*: Other list operations. - (line 30) -* -cons-pair?: Predicates. (line 167) + (line 19) +* -cons-pair?: Predicates. (line 154) * -const: Function combinators. (line 128) * -contains?: Predicates. (line 100) -* -copy: Maps. (line 141) +* -copy: Maps. (line 151) * -count: Reductions. (line 172) * -cut: Function combinators. (line 140) -* -cycle: Other list operations. - (line 180) -* -difference: Set operations. (line 20) -* -distinct: Set operations. (line 62) +* -cycle: Unfolding. (line 55) +* -difference: Set operations. (line 22) +* -distinct: Set operations. (line 73) * -dotimes: Side effects. (line 80) * -doto: Threading macros. (line 99) * -drop: Sublist selection. (line 149) @@ -4366,20 +4453,20 @@ Index * -each-r-while: Side effects. (line 65) * -each-while: Side effects. (line 24) * -elem-index: Indexing. (line 9) -* -elem-indices: Indexing. (line 21) +* -elem-indices: Indexing. (line 23) * -every: Predicates. (line 23) * -fifth-item: Other list operations. - (line 315) + (line 308) * -filter: Sublist selection. (line 8) -* -find-index: Indexing. (line 32) -* -find-indices: Indexing. (line 60) -* -find-last-index: Indexing. (line 46) +* -find-index: Indexing. (line 35) +* -find-indices: Indexing. (line 73) +* -find-last-index: Indexing. (line 54) * -first: Other list operations. - (line 246) + (line 228) * -first-item: Other list operations. - (line 272) + (line 256) * -fix: Other list operations. - (line 375) + (line 373) * -fixfn: Function combinators. (line 224) * -flatten: List to list. (line 36) @@ -4387,24 +4474,25 @@ Index * -flip: Function combinators. (line 95) * -fourth-item: Other list operations. - (line 305) -* -grade-down: Indexing. (line 81) -* -grade-up: Indexing. (line 71) + (line 295) +* -frequencies: Reductions. (line 310) +* -grade-down: Indexing. (line 103) +* -grade-up: Indexing. (line 93) * -group-by: Partitioning. (line 205) * -if-let: Binding. (line 34) * -if-let*: Binding. (line 45) * -inits: Reductions. (line 222) * -insert-at: List to list. (line 112) * -interleave: Other list operations. - (line 67) + (line 56) * -interpose: Other list operations. - (line 57) -* -intersection: Set operations. (line 32) + (line 46) +* -intersection: Set operations. (line 36) * -iota: Other list operations. - (line 78) -* -is-infix?: Predicates. (line 153) -* -is-prefix?: Predicates. (line 129) -* -is-suffix?: Predicates. (line 141) + (line 67) +* -is-infix?: Predicates. (line 140) +* -is-prefix?: Predicates. (line 116) +* -is-suffix?: Predicates. (line 128) * -iterate: Unfolding. (line 9) * -iteratefn: Function combinators. (line 201) @@ -4413,19 +4501,19 @@ Index * -keep: List to list. (line 8) * -lambda: Binding. (line 247) * -last: Other list operations. - (line 262) + (line 246) * -last-item: Other list operations. - (line 325) + (line 321) * -let: Binding. (line 61) * -let*: Binding. (line 227) * -list: Other list operations. - (line 358) + (line 356) * -map: Maps. (line 10) * -map-first: Maps. (line 38) * -map-indexed: Maps. (line 68) * -map-last: Maps. (line 53) * -map-when: Maps. (line 22) -* -mapcat: Maps. (line 130) +* -mapcat: Maps. (line 140) * -max: Reductions. (line 286) * -max-by: Reductions. (line 296) * -min: Reductions. (line 262) @@ -4440,7 +4528,7 @@ Index * -orfn: Function combinators. (line 167) * -pad: Other list operations. - (line 191) + (line 169) * -partial: Function combinators. (line 8) * -partition: Partitioning. (line 90) @@ -4453,8 +4541,8 @@ Index * -partition-by: Partitioning. (line 138) * -partition-by-header: Partitioning. (line 149) * -partition-in-steps: Partitioning. (line 113) -* -permutations: Set operations. (line 52) -* -powerset: Set operations. (line 44) +* -permutations: Set operations. (line 60) +* -powerset: Set operations. (line 50) * -prodfn: Function combinators. (line 258) * -product: Reductions. (line 201) @@ -4472,8 +4560,7 @@ Index * -remove-first: Sublist selection. (line 44) * -remove-item: Sublist selection. (line 84) * -remove-last: Sublist selection. (line 65) -* -repeat: Other list operations. - (line 19) +* -repeat: Unfolding. (line 44) * -replace: List to list. (line 70) * -replace-at: List to list. (line 123) * -replace-first: List to list. (line 84) @@ -4486,9 +4573,9 @@ Index (line 22) * -running-product: Reductions. (line 211) * -running-sum: Reductions. (line 190) -* -same-items?: Predicates. (line 115) +* -same-items?: Set operations. (line 88) * -second-item: Other list operations. - (line 285) + (line 269) * -select-by-indices: Sublist selection. (line 211) * -select-column: Sublist selection. (line 241) * -select-columns: Sublist selection. (line 222) @@ -4496,30 +4583,30 @@ Index * -setq: Binding. (line 270) * -slice: Sublist selection. (line 105) * -snoc: Other list operations. - (line 43) + (line 32) * -some: Predicates. (line 8) * -some-->: Threading macros. (line 86) * -some->: Threading macros. (line 62) * -some->>: Threading macros. (line 74) * -sort: Other list operations. - (line 345) -* -splice: Maps. (line 97) -* -splice-list: Maps. (line 117) + (line 343) +* -splice: Maps. (line 102) +* -splice-list: Maps. (line 127) * -split-at: Partitioning. (line 8) * -split-on: Partitioning. (line 40) * -split-when: Partitioning. (line 58) * -split-with: Partitioning. (line 23) * -sum: Reductions. (line 180) * -table: Other list operations. - (line 202) + (line 184) * -table-flat: Other list operations. - (line 221) + (line 203) * -tails: Reductions. (line 232) * -take: Sublist selection. (line 121) * -take-last: Sublist selection. (line 135) * -take-while: Sublist selection. (line 177) * -third-item: Other list operations. - (line 295) + (line 282) * -tree-map: Tree operations. (line 28) * -tree-map-nodes: Tree operations. (line 39) * -tree-mapreduce: Tree operations. (line 85) @@ -4530,18 +4617,18 @@ Index * -unfold: Unfolding. (line 25) * -union: Set operations. (line 8) * -unzip: Other list operations. - (line 158) + (line 147) * -update-at: List to list. (line 135) * -when-let: Binding. (line 9) * -when-let*: Binding. (line 21) * -zip: Other list operations. - (line 107) + (line 96) * -zip-fill: Other list operations. - (line 150) + (line 139) * -zip-lists: Other list operations. - (line 131) + (line 120) * -zip-with: Other list operations. - (line 91) + (line 80) * dash-fontify-mode: Fontification of special variables. (line 6) * dash-register-info-lookup: Info symbol lookup. (line 6) @@ -4564,199 +4651,200 @@ Ref: -map-first7605 Ref: -map-last8200 Ref: -map-indexed8790 Ref: -annotate9476 -Ref: -splice9963 -Ref: -splice-list10741 -Ref: -mapcat11200 -Ref: -copy11573 -Node: Sublist selection11761 -Ref: -filter11954 -Ref: -remove12507 -Ref: -remove-first13056 -Ref: -remove-last13904 -Ref: -remove-item14634 -Ref: -non-nil15034 -Ref: -slice15316 -Ref: -take15845 -Ref: -take-last16263 -Ref: -drop16700 -Ref: -drop-last17147 -Ref: -take-while17579 -Ref: -drop-while18206 -Ref: -select-by-indices18839 -Ref: -select-columns19350 -Ref: -select-column20053 -Node: List to list20516 -Ref: -keep20708 -Ref: -concat21284 -Ref: -flatten21767 -Ref: -flatten-n22529 -Ref: -replace22913 -Ref: -replace-first23374 -Ref: -replace-last23869 -Ref: -insert-at24357 -Ref: -replace-at24682 -Ref: -update-at25069 -Ref: -remove-at25610 -Ref: -remove-at-indices26095 -Node: Reductions26674 -Ref: -reduce-from26870 -Ref: -reduce-r-from27594 -Ref: -reduce28857 -Ref: -reduce-r29608 -Ref: -reductions-from30886 -Ref: -reductions-r-from31692 -Ref: -reductions32522 -Ref: -reductions-r33233 -Ref: -count33978 -Ref: -sum34208 -Ref: -running-sum34396 -Ref: -product34717 -Ref: -running-product34925 -Ref: -inits35266 -Ref: -tails35511 -Ref: -common-prefix35755 -Ref: -common-suffix36049 -Ref: -min36343 -Ref: -min-by36569 -Ref: -max37090 -Ref: -max-by37315 -Node: Unfolding37841 -Ref: -iterate38082 -Ref: -unfold38529 -Node: Predicates39334 -Ref: -some39511 -Ref: -every39940 -Ref: -any?40654 -Ref: -all?41003 -Ref: -none?41745 -Ref: -only-some?42065 -Ref: -contains?42610 -Ref: -same-items?43011 -Ref: -is-prefix?43396 -Ref: -is-suffix?43728 -Ref: -is-infix?44060 -Ref: -cons-pair?44420 -Node: Partitioning44751 -Ref: -split-at44939 -Ref: -split-with45603 -Ref: -split-on46243 -Ref: -split-when46914 -Ref: -separate47557 -Ref: -partition48091 -Ref: -partition-all48540 -Ref: -partition-in-steps48965 -Ref: -partition-all-in-steps49511 -Ref: -partition-by50025 -Ref: -partition-by-header50403 -Ref: -partition-after-pred51004 -Ref: -partition-before-pred51457 -Ref: -partition-before-item51842 -Ref: -partition-after-item52149 -Ref: -group-by52451 -Node: Indexing52884 -Ref: -elem-index53086 -Ref: -elem-indices53487 -Ref: -find-index53867 -Ref: -find-last-index54362 -Ref: -find-indices54872 -Ref: -grade-up55277 -Ref: -grade-down55684 -Node: Set operations56098 -Ref: -union56281 -Ref: -difference56695 -Ref: -intersection57113 -Ref: -powerset57526 -Ref: -permutations57736 -Ref: -distinct58032 -Node: Other list operations58412 -Ref: -rotate58637 -Ref: -repeat58990 -Ref: -cons*59275 -Ref: -snoc59697 -Ref: -interpose60109 -Ref: -interleave60403 -Ref: -iota60769 -Ref: -zip-with61252 -Ref: -zip61966 -Ref: -zip-lists62795 -Ref: -zip-fill63493 -Ref: -unzip63815 -Ref: -cycle64557 -Ref: -pad64956 -Ref: -table65275 -Ref: -table-flat66061 -Ref: -first67066 -Ref: -last67564 -Ref: -first-item67910 -Ref: -second-item68315 -Ref: -third-item68585 -Ref: -fourth-item68853 -Ref: -fifth-item69125 -Ref: -last-item69393 -Ref: -butlast69690 -Ref: -sort69935 -Ref: -list70427 -Ref: -fix70996 -Node: Tree operations71485 -Ref: -tree-seq71681 -Ref: -tree-map72542 -Ref: -tree-map-nodes72982 -Ref: -tree-reduce73846 -Ref: -tree-reduce-from74728 -Ref: -tree-mapreduce75328 -Ref: -tree-mapreduce-from76187 -Ref: -clone77472 -Node: Threading macros77799 -Ref: ->78024 -Ref: ->>78512 -Ref: -->79015 -Ref: -as->79571 -Ref: -some->80025 -Ref: -some->>80410 -Ref: -some-->80857 -Ref: -doto81424 -Node: Binding81977 -Ref: -when-let82184 -Ref: -when-let*82645 -Ref: -if-let83174 -Ref: -if-let*83540 -Ref: -let84163 -Ref: -let*90253 -Ref: -lambda91190 -Ref: -setq91996 -Node: Side effects92797 -Ref: -each92991 -Ref: -each-while93518 -Ref: -each-indexed94138 -Ref: -each-r94730 -Ref: -each-r-while95172 -Ref: -dotimes95816 -Node: Destructive operations96369 -Ref: !cons96587 -Ref: !cdr96791 -Node: Function combinators96984 -Ref: -partial97188 -Ref: -rpartial97706 -Ref: -juxt98354 -Ref: -compose98806 -Ref: -applify99413 -Ref: -on99843 -Ref: -flip100615 -Ref: -rotate-args101139 -Ref: -const101768 -Ref: -cut102110 -Ref: -not102590 -Ref: -orfn103134 -Ref: -andfn103927 -Ref: -iteratefn104714 -Ref: -fixfn105416 -Ref: -prodfn106990 -Node: Development108151 -Node: Contribute108440 -Node: Contributors109452 -Node: FDL111545 -Node: GPL136865 -Node: Index174614 +Ref: -splice10080 +Ref: -splice-list11155 +Ref: -mapcat11614 +Ref: -copy11987 +Node: Sublist selection12175 +Ref: -filter12368 +Ref: -remove12921 +Ref: -remove-first13470 +Ref: -remove-last14318 +Ref: -remove-item15048 +Ref: -non-nil15448 +Ref: -slice15730 +Ref: -take16259 +Ref: -take-last16677 +Ref: -drop17114 +Ref: -drop-last17561 +Ref: -take-while17993 +Ref: -drop-while18620 +Ref: -select-by-indices19253 +Ref: -select-columns19764 +Ref: -select-column20467 +Node: List to list20930 +Ref: -keep21122 +Ref: -concat21698 +Ref: -flatten22181 +Ref: -flatten-n22943 +Ref: -replace23327 +Ref: -replace-first23788 +Ref: -replace-last24283 +Ref: -insert-at24771 +Ref: -replace-at25096 +Ref: -update-at25483 +Ref: -remove-at26024 +Ref: -remove-at-indices26509 +Node: Reductions27088 +Ref: -reduce-from27284 +Ref: -reduce-r-from28008 +Ref: -reduce29271 +Ref: -reduce-r30022 +Ref: -reductions-from31300 +Ref: -reductions-r-from32106 +Ref: -reductions32936 +Ref: -reductions-r33647 +Ref: -count34392 +Ref: -sum34622 +Ref: -running-sum34810 +Ref: -product35131 +Ref: -running-product35339 +Ref: -inits35680 +Ref: -tails35925 +Ref: -common-prefix36169 +Ref: -common-suffix36463 +Ref: -min36757 +Ref: -min-by36983 +Ref: -max37504 +Ref: -max-by37729 +Ref: -frequencies38255 +Node: Unfolding38870 +Ref: -iterate39111 +Ref: -unfold39558 +Ref: -repeat40363 +Ref: -cycle40647 +Node: Predicates41046 +Ref: -some41223 +Ref: -every41652 +Ref: -any?42366 +Ref: -all?42715 +Ref: -none?43457 +Ref: -only-some?43777 +Ref: -contains?44322 +Ref: -is-prefix?44828 +Ref: -is-suffix?45160 +Ref: -is-infix?45492 +Ref: -cons-pair?45852 +Node: Partitioning46183 +Ref: -split-at46371 +Ref: -split-with47035 +Ref: -split-on47675 +Ref: -split-when48346 +Ref: -separate48989 +Ref: -partition49523 +Ref: -partition-all49972 +Ref: -partition-in-steps50397 +Ref: -partition-all-in-steps50943 +Ref: -partition-by51457 +Ref: -partition-by-header51835 +Ref: -partition-after-pred52436 +Ref: -partition-before-pred52889 +Ref: -partition-before-item53274 +Ref: -partition-after-item53581 +Ref: -group-by53883 +Node: Indexing54316 +Ref: -elem-index54518 +Ref: -elem-indices55005 +Ref: -find-index55464 +Ref: -find-last-index56133 +Ref: -find-indices56784 +Ref: -grade-up57546 +Ref: -grade-down57953 +Node: Set operations58367 +Ref: -union58550 +Ref: -difference58980 +Ref: -intersection59408 +Ref: -powerset59837 +Ref: -permutations60114 +Ref: -distinct60552 +Ref: -same-items?60946 +Node: Other list operations61555 +Ref: -rotate61780 +Ref: -cons*62133 +Ref: -snoc62555 +Ref: -interpose62967 +Ref: -interleave63261 +Ref: -iota63627 +Ref: -zip-with64110 +Ref: -zip64824 +Ref: -zip-lists65653 +Ref: -zip-fill66351 +Ref: -unzip66673 +Ref: -pad67415 +Ref: -table67900 +Ref: -table-flat68686 +Ref: -first69691 +Ref: -last70224 +Ref: -first-item70570 +Ref: -second-item70982 +Ref: -third-item71399 +Ref: -fourth-item71774 +Ref: -fifth-item72152 +Ref: -last-item72527 +Ref: -butlast72888 +Ref: -sort73133 +Ref: -list73625 +Ref: -fix74194 +Node: Tree operations74683 +Ref: -tree-seq74879 +Ref: -tree-map75740 +Ref: -tree-map-nodes76180 +Ref: -tree-reduce77044 +Ref: -tree-reduce-from77926 +Ref: -tree-mapreduce78526 +Ref: -tree-mapreduce-from79385 +Ref: -clone80670 +Node: Threading macros80997 +Ref: ->81222 +Ref: ->>81710 +Ref: -->82213 +Ref: -as->82769 +Ref: -some->83223 +Ref: -some->>83608 +Ref: -some-->84055 +Ref: -doto84622 +Node: Binding85175 +Ref: -when-let85382 +Ref: -when-let*85843 +Ref: -if-let86372 +Ref: -if-let*86738 +Ref: -let87361 +Ref: -let*93451 +Ref: -lambda94388 +Ref: -setq95194 +Node: Side effects95995 +Ref: -each96189 +Ref: -each-while96716 +Ref: -each-indexed97336 +Ref: -each-r97928 +Ref: -each-r-while98370 +Ref: -dotimes99014 +Node: Destructive operations99567 +Ref: !cons99785 +Ref: !cdr99989 +Node: Function combinators100182 +Ref: -partial100386 +Ref: -rpartial100904 +Ref: -juxt101552 +Ref: -compose102004 +Ref: -applify102611 +Ref: -on103041 +Ref: -flip103813 +Ref: -rotate-args104337 +Ref: -const104966 +Ref: -cut105308 +Ref: -not105788 +Ref: -orfn106332 +Ref: -andfn107125 +Ref: -iteratefn107912 +Ref: -fixfn108614 +Ref: -prodfn110188 +Node: Development111349 +Node: Contribute111638 +Node: Contributors112650 +Node: FDL114743 +Node: GPL140063 +Node: Index177812  End Tag Table diff --git a/elpa/dash-20220417.2250/dir b/elpa/dash-20220608.1931/dir similarity index 100% rename from elpa/dash-20220417.2250/dir rename to elpa/dash-20220608.1931/dir