Files
emacsd/elpa/dash-20191109.1327/dash.elc

1851 lines
99 KiB
Plaintext
Raw Normal View History

2019-10-27 20:23:01 +01:00
;ELC
;;; Compiled
;;; in Emacs version 26.3
;;; with all optimizations.
;;; This file uses dynamic docstrings, first added in Emacs 19.29.
;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(custom-declare-group 'dash nil "Customize group for dash.el" :group 'lisp :prefix "dash-")
#@21
(fn SYMBOL VALUE)
(defalias 'dash--enable-fontlock #[514 "\211\203\300 \210\301\"\207" [dash-enable-font-lock set-default] 5 (#$ . 500)])
(byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313& \207" [custom-declare-variable dash-enable-fontlock funcall function #[0 "\300\207" [nil] 1] "If non-nil, enable fontification of dash functions, macros and\nspecial values." :type boolean :set dash--enable-fontlock :group dash] 10)
#@64 Destructive: Set CDR to the cons of CAR and CDR.
(fn CAR CDR)
(defalias '!cons '(macro . #[514 "\300\301EE\207" [setq cons] 7 (#$ . 947)]))
#@54 Destructive: Set LIST to the cdr of LIST.
(fn LIST)
(defalias '!cdr '(macro . #[257 "\300\301DE\207" [setq cdr] 5 (#$ . 1097)]))
#@50 Anaphoric form of `-each'.
(fn LIST &rest BODY)
(defalias '--each '(macro . #[385 "\300\301!\302D\303B\304\302\305\306DDCBB\307\310D\257E\207" [make-symbol "list" let ((it-index 0)) while it car (setq it-index (1+ it-index)) !cdr] 11 (#$ . 1235)]))
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put --each edebug-form-spec (form body) function-put lisp-indent-function 1] 4)
#@251 Eval a form, then insert that form as the 2nd argument to other forms.
The EVAL-INITIAL-VALUE form is evaluated once. Its result is
passed to FORMS, which are then evaluated sequentially. Returns
the target form.
(fn EVAL-INITIAL-VALUE &rest FORMS)
(defalias '-doto '(macro . #[385 "\300\301!\302DC\303\304\305\306\307\310\311 !\312\"\313\314%\"C\"BB\207" [make-symbol "value" let append mapcar make-byte-code 257 "\301!\203\302!\300ABB\207\303\304\300E\207" vconcat vector [sequencep -first-item funcall form] 4 "\n\n(fn FORM)"] 13 (#$ . 1643)]))
(byte-code "\300\301\302\303#\300\207" [function-put -doto lisp-indent-function 1] 4)
#@106 Anaphoric form of `-doto'.
Note: `it' is not required in each form.
(fn EVAL-INITIAL-VALUE &rest FORMS)
(defalias '--doto '(macro . #[385 "\300\301DC\302\303\"BB\207" [let it append (it)] 7 (#$ . 2296)]))
(byte-code "\300\301\302\303#\300\207" [function-put --doto lisp-indent-function 1] 4)
#@88 Call FN with every item in LIST. Return nil, used for side-effects only.
(fn LIST FN)
(defalias '-each #[514 "\300\205@!\266\211T\262A\262\202\207" [0] 7 (#$ . 2597)])
(byte-code "\300\301\302\303#\210\304\305\306\"\207" [put -each lisp-indent-function 1 defalias --each-indexed --each] 4)
#@170 Call (FN index item) for each item in LIST.
In the anaphoric form `--each-indexed', the index is exposed as symbol `it-index'.
See also: `-map-indexed'.
(fn LIST FN)
(defalias '-each-indexed #[514 "\300\205@\"\266\211T\262A\262\202\207" [0] 8 (#$ . 2908)])
(put '-each-indexed 'lisp-indent-function 1)
#@61 Anaphoric form of `-each-while'.
(fn LIST PRED &rest BODY)
(defalias '--each-while '(macro . #[642 "\300\301!\300\302!\303D\304B\305BB\306\307E\303\310\311DDC\312\313 D\314 \315BB BBBE\316\317D\257E\207" [make-symbol "list" "continue" let (t) ((it-index 0)) while and it car if not setq (nil) (setq it-index (1+ it-index)) !cdr] 16 (#$ . 3233)]))
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put --each-while edebug-form-spec (form form body) function-put lisp-indent-function 2] 4)
#@122 Call FN with every item in LIST while (PRED item) is non-nil.
Return nil, used for side-effects only.
(fn LIST PRED FN)
(defalias '-each-while #[771 "\300\301\205)\205)@!\204\302\262\202!\210\210\211T\262A\262\202\207" [t 0 nil] 9 (#$ . 3754)])
(put '-each-while 'lisp-indent-function 2)
#@52 Anaphoric form of `-each-r'.
(fn LIST &rest BODY)
(defalias '--each-r '(macro . #[385 "\300\301!\302\303DD\304\305DD\306BB\307\310\311\312\313\314\315BBEBBBBE\207" [make-symbol "vector" let* vconcat it-index length (it) while (> it-index 0) (setq it-index (1- it-index)) setq it aref (it-index)] 13 (#$ . 4069)]))
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put --each-r edebug-form-spec (form body) function-put lisp-indent-function 1] 4)
#@107 Call FN with every item in LIST in reversed order.
Return nil, used for side-effects only.
(fn LIST FN)
(defalias '-each-r #[514 "\300!\211G\301\302V\205S\262H\262!\210\202\207" [vconcat nil 0] 7 (#$ . 4541)])
#@63 Anaphoric form of `-each-r-while'.
(fn LIST PRED &rest BODY)
(defalias '--each-r-while '(macro . #[642 "\300\301!\302\303DD\304\305DD\306BB\307\310\311\312\313\314\315BBE\316\317\nD\320\nBBB\257E\207" [make-symbol "vector" let* vconcat it-index length (it) while (> it-index 0) (setq it-index (1- it-index)) setq it aref (it-index) if not (setq it-index -1)] 14 (#$ . 4772)]))
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put --each-r-while edebug-form-spec (form form body) function-put lisp-indent-function 2] 4)
#@131 Call FN with every item in reversed LIST while (PRED item) is non-nil.
Return nil, used for side-effects only.
(fn LIST PRED FN)
(defalias '-each-r-while #[771 "\300!\211G\301\302V\205(S\262H\262!\204!\303\262\202!\210\202\207" [vconcat nil 0 -1] 8 (#$ . 5320)])
#@134 Repeatedly executes BODY (presumably for side-effects) with symbol `it' bound to integers from 0 through NUM-1.
(fn NUM &rest BODY)
(defalias '--dotimes '(macro . #[385 "\300\301!\302D\303B\304\305\306E\307\310\"BBE\207" [make-symbol "num" let ((it 0)) while < it append ((setq it (1+ it)))] 10 (#$ . 5609)]))
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put --dotimes edebug-form-spec (form body) function-put lisp-indent-function 1] 4)
#@106 Repeatedly calls FN (presumably for side-effects) passing in integers from 0 through NUM-1.
(fn NUM FN)
(defalias '-dotimes #[514 "\300\211W\205!\210\211T\262\202\207" [0] 6 (#$ . 6076)])
(put '-dotimes 'lisp-indent-function 1)
#@95 Return a new list consisting of the result of applying FN to the items in LIST.
(fn FN LIST)
(defalias '-map #[514 "\300\"\207" [mapcar] 5 (#$ . 6320)])
#@43 Anaphoric form of `-map'.
(fn FORM LIST)
(defalias '--map '(macro . #[514 "\300\301\302EE\207" [mapcar lambda (it)] 6 (#$ . 6482)]))
(put '--map 'edebug-form-spec '(form form))
#@65 Anaphoric form of `-reduce-from'.
(fn FORM INITIAL-VALUE LIST)
(defalias '--reduce-from '(macro . #[771 "\300\301DC\302\303\301EE\304BBB\207" [let acc --each setq (acc)] 10 (#$ . 6668)]))
(put '--reduce-from 'edebug-form-spec '(form form form))
#@354 Return the result of applying FN to INITIAL-VALUE and the
first item in LIST, then applying FN to that result and the 2nd
item, etc. If LIST contains no items, return INITIAL-VALUE and
do not call FN.
In the anaphoric form `--reduce-from', the accumulated value is
exposed as symbol `acc'.
See also: `-reduce', `-reduce-r'
(fn FN INITIAL-VALUE LIST)
(defalias '-reduce-from #[771 "\300\203@\"\262\210\211T\262A\262\202\266\211\207" [0] 10 (#$ . 6925)])
#@46 Anaphoric form of `-reduce'.
(fn FORM LIST)
(defalias '--reduce '(macro . #[514 "\300\301!\302DC\303\304\305D\306DF\302\307 EFE\207" [make-symbol "list-value" let if --reduce-from car cdr (acc it)] 12 (#$ . 7404)]))
(put '--reduce 'edebug-form-spec '(form form))
#@404 Return the result of applying FN to the first 2 items in LIST,
then applying FN to that result and the 3rd item, etc. If LIST
contains no items, return the result of calling FN with no
arguments. If LIST contains a single item, return that item
and do not call FN.
In the anaphoric form `--reduce', the accumulated value is
exposed as symbol `acc'.
See also: `-reduce-from', `-reduce-r'
(fn FN LIST)
(defalias '-reduce #[514 "\211\203\f\300@A#\207 \207" [-reduce-from] 6 (#$ . 7685)])
#@70 Anaphoric version of `-reduce-r-from'.
(fn FORM INITIAL-VALUE LIST)
(defalias '--reduce-r-from '(macro . #[771 "\300\301DF\207" [--reduce-from reverse] 8 (#$ . 8184)]))
(put '--reduce-r-from 'edebug-form-spec '(form form form))
#@331 Replace conses with FN, nil with INITIAL-VALUE and evaluate
the resulting expression. If LIST is empty, INITIAL-VALUE is
returned and FN is not called.
Note: this function works the same as `-reduce-from' but the
operation associates from right instead of from left.
See also: `-reduce-r', `-reduce'
(fn FN INITIAL-VALUE LIST)
(defalias '-reduce-r-from #[771 "\300!\301\203@\"\262\210\211T\262A\262\202\266\211\207" [reverse 0] 10 (#$ . 8423)])
#@51 Anaphoric version of `-reduce-r'.
(fn FORM LIST)
(defalias '--reduce-r '(macro . #[514 "\300\301DE\207" [--reduce reverse] 6 (#$ . 8894)]))
(put '--reduce-r 'edebug-form-spec '(form form))
#@480 Replace conses with FN and evaluate the resulting expression.
The final nil is ignored. If LIST contains no items, return the
result of calling FN with no arguments. If LIST contains a single
item, return that item and do not call FN.
The first argument of FN is the new item, the second is the
accumulated value.
Note: this function works the same as `-reduce' but the operation
associates from right instead of from left.
See also: `-reduce-r-from', `-reduce'
(fn FN LIST)
(defalias '-reduce-r #[514 "\211\203:\300!\211\2031\211@A\301\203)@\"\262\210\211T\262A\262\202\266\211\262\2029\302\211\"\266\202\207 \207" [reverse 0 nil] 10 (#$ . 9093)])
#@188 Return a list of the intermediate values of the reduction.
See `-reduce-from' for explanation of the arguments.
See also: `-reductions', `-reductions-r', `-reduce-r'
(fn FN INIT LIST)
(defalias '-reductions-from #[771 "C\300\203 @@\"B\262\210\211T\262A\262\202\266\211\262\237\207" [0] 10 (#$ . 9777)])
#@183 Return a list of the intermediate values of the reduction.
See `-reduce' for explanation of the arguments.
See also: `-reductions-from', `-reductions-r', `-reduce-r'
(fn FN LIST)
(defalias '-reductions #[514 "\211\205 \300@A#\207" [-reductions-from] 6 (#$ . 10108)])
#@188 Return a list of the intermediate values of the reduction.
See `-reduce-r-from' for explanation of the arguments.
See also: `-reductions-r', `-reductions', `-reduce'
(fn FN INIT LIST)
(defalias '-reductions-r-from #[771 "C\300!\301\203\"@@\"B\262\210\211T\262A\262\202\266\211\207" [reverse 0] 10 (#$ . 10389)])
#@183 Return a list of the intermediate values of the reduction.
See `-reduce-r' for explanation of the arguments.
See also: `-reductions-r-from', `-reductions', `-reduce'
(fn FN LIST)
(defalias '-reductions-r #[514 "\211\2050\300!\211@CA\301\203)@@\"B\262\210\211T\262A\262\202 \266\211\262\262\207" [reverse 0] 10 (#$ . 10728)])
#@69 Anaphoric form of `-filter'.
See also: `--remove'.
(fn FORM LIST)
(defalias '--filter '(macro . #[514 "\300\301!\302C\303\304\305\306EEE\307DF\207" [make-symbol "result" let --each when !cons it nreverse] 12 (#$ . 11081)]))
(put '--filter 'edebug-form-spec '(form form))
#@145 Return a new list of the items in LIST for which PRED returns a non-nil value.
Alias: `-select'
See also: `-keep', `-remove'.
(fn PRED LIST)
(defalias '-filter #[514 "\300\301\203 @!\203\211B\262\210\211T\262A\262\202\266\211\237\207" [nil 0] 8 (#$ . 11368)])
(byte-code "\300\301\302\"\210\300\303\304\"\207" [defalias -select -filter --select --filter] 3)
#@68 Anaphoric form of `-remove'.
See also `--filter'.
(fn FORM LIST)
(defalias '--remove '(macro . #[514 "\300\301DE\207" [--filter not] 5 (#$ . 11751)]))
(put '--remove 'edebug-form-spec '(form form))
#@124 Return a new list of the items in LIST for which PRED returns nil.
Alias: `-reject'
See also: `-filter'.
(fn PRED LIST)
(defalias '-remove #[514 "\300\301\203 @!\204\211B\262\210\211T\262A\262\202\266\211\237\207" [nil 0] 8 (#$ . 11960)])
(byte-code "\300\301\302\"\210\300\303\304\"\207" [defalias -reject -remove --reject --remove] 3)
#@137 Return a new list with the first item matching PRED removed.
Alias: `-reject-first'
See also: `-remove', `-map-first'
(fn PRED LIST)
(defalias '-remove-first #[514 "\300\203@!\204@B\262A\262\202\203&\301\237A\"\202(\211\237\207" [nil -concat] 6 (#$ . 12323)])
#@52 Anaphoric form of `-remove-first'.
(fn FORM LIST)
(defalias '--remove-first '(macro . #[514 "\300\301\302EE\207" [-remove-first lambda (it)] 6 (#$ . 12611)]))
(byte-code "\300\301\302\303#\210\304\305\306\"\210\304\307\301\"\207" [put --remove-first edebug-form-spec (form form) defalias -reject-first -remove-first --reject-first] 4)
#@134 Return a new list with the last item matching PRED removed.
Alias: `-reject-last'
See also: `-remove', `-map-last'
(fn PRED LIST)
(defalias '-remove-last #[514 "\300\301!\"\237\207" [-remove-first reverse] 6 (#$ . 12956)])
#@51 Anaphoric form of `-remove-last'.
(fn FORM LIST)
(defalias '--remove-last '(macro . #[514 "\300\301\302EE\207" [-remove-last lambda (it)] 6 (#$ . 13190)]))
(byte-code "\300\301\302\303#\210\304\305\306\"\210\304\307\301\"\207" [put --remove-last edebug-form-spec (form form) defalias -reject-last -remove-last --reject-last] 4)
2019-12-01 19:55:19 +01:00
#@93 Remove all occurrences of ITEM from LIST.
2019-10-27 20:23:01 +01:00
Comparison is done with `equal'.
(fn ITEM LIST)
(defalias '-remove-item #[514 "\300\301\203!@\211\232\204\211B\262\210\211T\262A\262\202\266\211\237\207" [nil 0] 8 (#$ . 13527)])
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -remove-item pure t side-effect-free] 5)
#@44 Anaphoric form of `-keep'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--keep '(macro . #[514 "\300\301!\300\302!\303C\304\303 DC\305\306  EEEE\307DF\207" [make-symbol "result" "mapped" let --each when !cons nreverse] 15 (#$ . 13883)]))
2019-10-27 20:23:01 +01:00
(put '--keep 'edebug-form-spec '(form form))
#@173 Return a new list of the non-nil results of applying FN to the items in LIST.
If you want to select the original items satisfying a predicate use `-filter'.
(fn FN LIST)
2019-12-01 19:55:19 +01:00
(defalias '-keep #[514 "\300\301\203\"@!\211\203\211B\262\266\211T\262A\262\202\266\211\237\207" [nil 0] 9 (#$ . 14164)])
2019-10-27 20:23:01 +01:00
#@49 Return all non-nil elements of LIST.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-non-nil #[257 "\300\301\"\207" [-remove null] 4 (#$ . 14481)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -non-nil pure t side-effect-free] 5)
#@51 Anaphoric form of `-map-indexed'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--map-indexed '(macro . #[514 "\300\301!\302C\303\304EE\305DF\207" [make-symbol "result" let --each !cons nreverse] 10 (#$ . 14718)]))
2019-10-27 20:23:01 +01:00
(put '--map-indexed 'edebug-form-spec '(form form))
#@211 Return a new list consisting of the result of (FN index item) for each item in LIST.
In the anaphoric form `--map-indexed', the index is exposed as symbol `it-index'.
See also: `-each-indexed'.
(fn FN LIST)
2019-12-01 19:55:19 +01:00
(defalias '-map-indexed #[514 "\300\301\203@\"B\262\210\211T\262A\262\202\266\211\237\207" [nil 0] 9 (#$ . 14980)])
2019-10-27 20:23:01 +01:00
#@52 Anaphoric form of `-map-when'.
(fn PRED REP LIST)
2019-12-01 19:55:19 +01:00
(defalias '--map-when '(macro . #[771 "\300\301!\302C\303\304\305  \306BBBEE\307DF\207" [make-symbol "result" let --each !cons if (it) nreverse] 13 (#$ . 15328)]))
2019-10-27 20:23:01 +01:00
(put '--map-when 'edebug-form-spec '(form form form))
#@266 Return a new list where the elements in LIST that do not match the PRED function
are unchanged, and where the elements in LIST that do match the PRED function are mapped
through the REP function.
Alias: `-replace-where'
See also: `-update-at'
(fn PRED REP LIST)
2019-12-01 19:55:19 +01:00
(defalias '-map-when #[771 "\300\301\203'@!\203!\202\211B\262\210\211T\262A\262\202\266\211\237\207" [nil 0] 9 (#$ . 15611)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\"\210\300\303\304\"\207" [defalias -replace-where -map-when --replace-where --map-when] 3)
#@145 Replace first item in LIST satisfying PRED with result of REP called on this item.
See also: `-map-when', `-replace-first'
(fn PRED REP LIST)
2019-12-01 19:55:19 +01:00
(defalias '-map-first #[771 "\300\203@!\204@B\262A\262\202\203+\301\237@!AB\"\202-\211\237\207" [nil -concat] 8 (#$ . 16146)])
2019-10-27 20:23:01 +01:00
#@53 Anaphoric form of `-map-first'.
(fn PRED REP LIST)
2019-12-01 19:55:19 +01:00
(defalias '--map-first '(macro . #[771 "\300\301\302E\301\303\304FF\207" [-map-first lambda (it) (it) (ignore it)] 9 (#$ . 16444)]))
2019-10-27 20:23:01 +01:00
#@143 Replace last item in LIST satisfying PRED with result of REP called on this item.
See also: `-map-when', `-replace-last'
(fn PRED REP LIST)
2019-12-01 19:55:19 +01:00
(defalias '-map-last #[771 "\300\301!#\237\207" [-map-first reverse] 8 (#$ . 16640)])
2019-10-27 20:23:01 +01:00
#@52 Anaphoric form of `-map-last'.
(fn PRED REP LIST)
2019-12-01 19:55:19 +01:00
(defalias '--map-last '(macro . #[771 "\300\301\302E\301\303\304FF\207" [-map-last lambda (it) (it) (ignore it)] 9 (#$ . 16877)]))
2019-10-27 20:23:01 +01:00
#@123 Replace all OLD items in LIST with NEW.
Elements are compared using `equal'.
See also: `-replace-at'
(fn OLD NEW LIST)
2019-12-01 19:55:19 +01:00
(defalias '-replace #[771 "\300\301\203%@\211\232\203\202\211B\262\210\211T\262A\262\202\266\211\237\207" [nil 0] 9 (#$ . 17070)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -replace pure t side-effect-free] 5)
2019-12-01 19:55:19 +01:00
#@136 Replace the first occurrence of OLD with NEW in LIST.
2019-10-27 20:23:01 +01:00
Elements are compared using `equal'.
See also: `-map-first'
(fn OLD NEW LIST)
2019-12-01 19:55:19 +01:00
(defalias '-replace-first #[771 "\300\301\302\303\304\305!\306\"\307\310%\301\302\311\304\305!\306\"\312\310%#\207" [-map-first make-byte-code 257 "\300\232\207" vconcat vector [] 3 "\n\n(fn IT)" "\300\207" 2] 11 (#$ . 17456)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -replace-first pure t side-effect-free] 5)
2019-12-01 19:55:19 +01:00
#@134 Replace the last occurrence of OLD with NEW in LIST.
2019-10-27 20:23:01 +01:00
Elements are compared using `equal'.
See also: `-map-last'
(fn OLD NEW LIST)
2019-12-01 19:55:19 +01:00
(defalias '-replace-last #[771 "\300\301\302\303\304\305!\306\"\307\310%\301\302\311\304\305!\306\"\312\310%#\207" [-map-last make-byte-code 257 "\300\232\207" vconcat vector [] 3 "\n\n(fn IT)" "\300\207" 2] 11 (#$ . 17945)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -replace-last pure t side-effect-free] 5)
#@46 Anaphoric form of `-mapcat'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--mapcat '(macro . #[514 "\300\301\302EE\207" [apply 'append --map] 7 (#$ . 18428)]))
2019-10-27 20:23:01 +01:00
(put '--mapcat 'edebug-form-spec '(form form))
#@118 Return the concatenation of the result of mapping FN over LIST.
Thus function FN should return a list.
(fn FN LIST)
2019-12-01 19:55:19 +01:00
(defalias '-mapcat #[514 "\300\301\302\303\304\305\306\307 !\310\"\311\312%\"\"\207" [apply append mapcar make-byte-code 257 "\300!\207" vconcat vector [] 3 "\n\n(fn IT)"] 11 (#$ . 18626)])
2019-10-27 20:23:01 +01:00
#@436 Take a nested list L and return its contents as a single, flat list.
Note that because `nil' represents a list of zero elements (an
empty list), any mention of nil in L will disappear after
flattening. If you need to preserve nils, consider `-flatten-n'
or map them to some unique symbol and then map them back.
Conses of two atoms are considered "terminals", that is, they
aren't flattened further.
See also: `-flatten-n'
(fn L)
2019-12-01 19:55:19 +01:00
(defalias '-flatten #[257 "\211<\203\211A<\203\300\301\"\207\211C\207" [-mapcat -flatten] 4 (#$ . 18943)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -flatten pure t side-effect-free] 5)
#@52 Anaphoric version of `-iterate'.
(fn FORM INIT N)
2019-12-01 19:55:19 +01:00
(defalias '--iterate '(macro . #[771 "\300\301\302EF\207" [-iterate lambda (it)] 7 (#$ . 19603)]))
2019-10-27 20:23:01 +01:00
(put '--iterate 'edebug-form-spec '(form form form))
#@75 Flatten NUM levels of a nested LIST.
See also: `-flatten'
(fn NUM LIST)
2019-12-01 19:55:19 +01:00
(defalias '-flatten-n #[514 "\300\301\302T#!\207" [-last-item -iterate #[257 "\300\301\302\303\"\"\207" [apply append mapcar #[257 "\300!\207" [-list] 3 "\n\n(fn IT)"]] 6 "\n\n(fn IT)"]] 7 (#$ . 19815)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -flatten-n pure t side-effect-free] 5)
#@99 Return a new list with the concatenation of the elements in the supplied LISTS.
(fn &rest LISTS)
2019-12-01 19:55:19 +01:00
(defalias '-concat #[128 "\300\301\"\207" [apply append] 4 (#$ . 20212)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\305\306\307\310#\207" [function-put -concat pure t side-effect-free defalias -copy copy-sequence "Create a shallow copy of LIST.\n\n(fn LIST)"] 6)
#@323 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'
(fn PRED FUN LIST)
2019-12-01 19:55:19 +01:00
(defalias '-splice #[771 "\300\301\203C@!\2032!\211\301\203-@\211B\262\210\211T\262A\262\202\266\2027\211B\262\210\211T\262A\262\202\266\211\237\207" [nil 0] 13 (#$ . 20586)])
2019-10-27 20:23:01 +01:00
#@51 Anaphoric form of `-splice'.
(fn PRED FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--splice '(macro . #[771 "\300\301\302E\301\303EF\207" [-splice lambda (it) (it)] 8 (#$ . 21121)]))
2019-10-27 20:23:01 +01:00
#@121 Splice NEW-LIST in place of elements matching PRED in LIST.
See also: `-splice', `-insert-at'
(fn PRED NEW-LIST LIST)
2019-12-01 19:55:19 +01:00
(defalias '-splice-list #[771 "\300\301\302\303\304\305!\306\"\307\310%#\207" [-splice make-byte-code 257 "\300\207" vconcat vector [] 2 "\n\n(fn _)"] 11 (#$ . 21292)])
2019-10-27 20:23:01 +01:00
#@60 Anaphoric form of `-splice-list'.
(fn PRED NEW-LIST LIST)
2019-12-01 19:55:19 +01:00
(defalias '--splice-list '(macro . #[771 "\300\301\302EF\207" [-splice-list lambda (it)] 7 (#$ . 21591)]))
2019-10-27 20:23:01 +01:00
#@204 Make a new list from the elements of ARGS.
The last 2 members of ARGS are used as the final cons of the
result so if the final member of ARGS is not a list the result is
a dotted list.
(fn &rest ARGS)
2019-12-01 19:55:19 +01:00
(defalias '-cons* #[128 "\300\301\"\207" [-reduce-r cons] 4 (#$ . 21767)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -cons* pure t side-effect-free] 5)
#@182 Append ELEM to the end of the list.
This is like `cons', but operates on the end of list.
If ELEMENTS is non nil, append these to the list as well.
(fn LIST ELEM &rest ELEMENTS)
2019-12-01 19:55:19 +01:00
(defalias '-snoc #[642 "\300C#\207" [-concat] 7 (#$ . 22158)])
2019-10-27 20:23:01 +01:00
#@45 Anaphoric form of `-first'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--first '(macro . #[514 "\300\301!\302C\303\304D\305\306\307BBEFF\207" [make-symbol "needle" let --each-while not when setq (it)] 13 (#$ . 22411)]))
2019-10-27 20:23:01 +01:00
(put '--first 'edebug-form-spec '(form form))
#@163 Return the first x in LIST where (PRED x) is non-nil, else nil.
To get the first item in the list no questions asked, use `car'.
Alias: `-find'
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-first #[514 "\300\301\302\203.\203.@\203\300\262\202\"!\203\"\211\262\210\211T\262A\262\202\266\211\207" [nil t 0] 9 (#$ . 22676)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\"\210\300\303\304\"\207" [defalias -find -first --find --first] 3)
#@44 Anaphoric form of `-some'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--some '(macro . #[514 "\300\301!\302C\303\304D\305 EFF\207" [make-symbol "needle" let --each-while not setq] 11 (#$ . 23102)]))
2019-10-27 20:23:01 +01:00
(put '--some 'edebug-form-spec '(form form))
#@109 Return (PRED x) for the first LIST item where (PRED x) is non-nil, else nil.
Alias: `-any'
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-some #[514 "\300\301\302\203*\203*@\203\300\262\202!\262\210\211T\262A\262\202\266\211\207" [nil t 0] 9 (#$ . 23344)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\"\210\300\303\304\"\207" [defalias -any -some --any --some] 3)
#@44 Anaphoric form of `-last'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--last '(macro . #[514 "\300\301!\302C\303\304\305\306BBEEF\207" [make-symbol "needle" let --each when setq (it)] 12 (#$ . 23699)]))
2019-10-27 20:23:01 +01:00
(put '--last 'edebug-form-spec '(form form))
#@80 Return the last x in LIST where (PRED x) is non-nil, else nil.
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-last #[514 "\300\301\203@!\203\211\262\210\211T\262A\262\202\266\211\207" [nil 0] 8 (#$ . 23944)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\210\304\301\305\306#\210\304\301\307\310#\210\300\311\312\313#\210\300\314\315\316!\203$\316\202%\317\320#\207" [defalias -first-item car "Return the first item of LIST, or nil on an empty list.\n\nSee also: `-second-item', `-last-item'.\n\n(fn LIST)" put byte-opcode byte-car byte-compile byte-compile-one-arg -second-item cadr "Return the second item of LIST, or nil if LIST is too short.\n\nSee also: `-third-item'.\n\n(fn LIST)" -third-item fboundp caddr #[257 "\211AA@\207" [] 2 "\n\n(fn LIST)"] "Return the third item of LIST, or nil if LIST is too short.\n\nSee also: `-fourth-item'.\n\n(fn LIST)"] 4)
#@99 Return the fourth item of LIST, or nil if LIST is too short.
See also: `-fifth-item'.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-fourth-item #[257 "\211AAA@\207" [] 2 (#$ . 24797)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -fourth-item pure t side-effect-free] 5)
#@97 Return the fifth item of LIST, or nil if LIST is too short.
See also: `-last-item'.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-fifth-item #[257 "\211AAAA@\207" [] 2 (#$ . 25077)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -fifth-item pure t side-effect-free] 5)
#@67 Return the last item of LIST, or nil on an empty list.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-last-item #[257 "\300!@\207" [last] 3 (#$ . 25354)])
2019-10-27 20:23:01 +01:00
(byte-code "\303\300\304\305#\303\300\306\305#\307\310!\203\303\300\311\312#\210\202'\313\301 \302 \314\315 D\nE$\210\303\207" [-last-item x val function-put pure t side-effect-free fboundp gv-define-setter gv-expander #[385 "\300\301\302$\207" [gv--defsetter -last-item #[514 "\300\301DE\207" [setcar last] 5 "\n\n(fn VAL X)"]] 7 "\n\n(fn DO &rest ARGS)"] defsetf setcar last] 9)
#@68 Return a list of all items in list except for the last.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-butlast #[257 "\300!\207" [butlast] 3 (#$ . 25881)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -butlast pure t side-effect-free] 5)
#@45 Anaphoric form of `-count'.
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '--count '(macro . #[514 "\300\301!\302\303BC\304\305\306\307 DEEEF\207" [make-symbol "result" let (0) --each when setq 1+] 13 (#$ . 26127)]))
2019-10-27 20:23:01 +01:00
(put '--count 'edebug-form-spec '(form form))
#@82 Counts the number of items in LIST where (PRED item) is non-nil.
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-count #[514 "\300\300\203@!\203T\262\210\211T\262A\262\202\266\211\207" [0] 8 (#$ . 26384)])
2019-10-27 20:23:01 +01:00
#@12
(fn VAL)
2019-12-01 19:55:19 +01:00
(defalias '---truthy\? #[257 "\211??\207" [] 2 (#$ . 26593)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put ---truthy\? pure t side-effect-free] 5)
#@44 Anaphoric form of `-any?'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--any\? '(macro . #[514 "\300\301ED\207" [---truthy\? --some] 6 (#$ . 26782)]))
2019-10-27 20:23:01 +01:00
(put '--any\? 'edebug-form-spec '(form form))
#@116 Return t if (PRED x) is non-nil for any x in LIST, else nil.
Alias: `-any-p', `-some?', `-some-p'
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-any\? #[514 "\300\301\302\303\203+\203+@\203\301\262\202!\262\210\211T\262A\262\202\266\211\262!\207" [---truthy\? nil t 0] 10 (#$ . 26971)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\"\210\300\303\304\"\210\300\305\302\"\210\300\306\304\"\210\300\307\302\"\210\300\310\304\"\207" [defalias -some\? -any\? --some\? --any\? -any-p --any-p -some-p --some-p] 3)
#@44 Anaphoric form of `-all?'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--all\? '(macro . #[514 "\300\301!\302\303BC\304\305 EF\306DF\207" [make-symbol "all" let (t) --each-while setq ---truthy\?] 11 (#$ . 27469)]))
2019-10-27 20:23:01 +01:00
(put '--all\? 'edebug-form-spec '(form form))
#@118 Return t if (PRED x) is non-nil for all x in LIST, else nil.
Alias: `-all-p', `-every?', `-every-p'
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-all\? #[514 "\300\300\301\203*\203*@\204\302\262\202!\262\210\211T\262A\262\202\266\303!\207" [t 0 nil ---truthy\?] 9 (#$ . 27727)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\"\210\300\303\304\"\210\300\305\302\"\210\300\306\304\"\210\300\307\302\"\210\300\310\304\"\207" [defalias -every\? -all\? --every\? --all\? -all-p --all-p -every-p --every-p] 3)
#@45 Anaphoric form of `-none?'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--none\? '(macro . #[514 "\300\301DE\207" [--all\? not] 5 (#$ . 28222)]))
2019-10-27 20:23:01 +01:00
(put '--none\? 'edebug-form-spec '(form form))
#@92 Return t if (PRED x) is nil for all x in LIST, else nil.
Alias: `-none-p'
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-none\? #[514 "\300\300\301\203+\203+@\204\302\262\202!?\262\210\211T\262A\262\202\266\303!\207" [t 0 nil ---truthy\?] 9 (#$ . 28406)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\"\210\300\303\304\"\207" [defalias -none-p -none\? --none-p --none\?] 3)
#@50 Anaphoric form of `-only-some?'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--only-some\? '(macro . #[514 "\300\301!\300\302!\303D\304\305\306ED\307 \310 \311BB\310 \312BBFF\313\306EDF\207" [make-symbol "yes" "no" let --each-while not and if setq (t) (t) ---truthy\?] 15 (#$ . 28771)]))
2019-10-27 20:23:01 +01:00
(put '--only-some\? 'edebug-form-spec '(form form))
#@240 Return `t` if at least one item of LIST matches PRED and at least one item of LIST does not match PRED.
Return `nil` both if all items match the predicate or if none of the items match the predicate.
Alias: `-only-some-p'
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-only-some\? #[514 "\300\211\301\302\2039\2039@\203\203\300\262\202-!\203*\301\262\202-\301\262\210\211T\262A\262\202\266\303\205A!\207" [nil t 0 ---truthy\?] 10 (#$ . 29115)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\"\210\300\303\304\"\207" [defalias -only-some-p -only-some\? --only-some-p --only-some\?] 3)
#@287 Return copy of LIST, starting from index FROM to index TO.
FROM or TO may be negative. These values are then interpreted
modulo the length of the list.
If STEP is a number, only each STEPth item in the resulting
section is returned. Defaults to 1.
(fn LIST FROM &optional TO STEP)
2019-12-01 19:55:19 +01:00
(defalias '-slice #[1026 "G\300\206\262\206\301\262\302W\203\303\"\262\302W\203)\303\"\262\304\302\203h\203h@W\204C\300\262\202\\ Y\203\\\303 Z\"\302U\203\\\211B\262\210\211T\262A\262\202,\266\211\237\207" [nil 1 0 mod t] 13 (#$ . 29697)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -slice pure t side-effect-free] 5)
#@126 Return a new list of the first N items in LIST, or all items if there are fewer than N.
See also: `-take-last'
(fn N LIST)
2019-12-01 19:55:19 +01:00
(defalias '-take #[514 "\300\301\211W\203\203@B\262A\262\211T\262\202\266\211\237\207" [nil 0] 7 (#$ . 30383)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -take pure t side-effect-free] 5)
#@75 Return the last N items of LIST in order.
See also: `-take'
(fn N LIST)
2019-12-01 19:55:19 +01:00
(defalias '-take-last #[514 "\300\301\"!\207" [copy-sequence last] 6 (#$ . 30746)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\305\306\307\310#\207" [function-put -take-last pure t side-effect-free defalias -drop nthcdr "Return the tail of LIST without the first N items.\n\nSee also: `-drop-last'\n\n(fn N LIST)"] 6)
#@84 Remove the last N items of LIST and return a copy.
See also: `-drop'
(fn N LIST)
2019-12-01 19:55:19 +01:00
(defalias '-drop-last #[514 "\300\"\207" [butlast] 5 (#$ . 31150)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -drop-last pure t side-effect-free] 5)
#@50 Anaphoric form of `-take-while'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--take-while '(macro . #[514 "\300\301!\302C\303\304\305EF\306DF\207" [make-symbol "result" let --each-while !cons it nreverse] 11 (#$ . 31418)]))
2019-10-27 20:23:01 +01:00
(put '--take-while 'edebug-form-spec '(form form))
#@108 Return a new list of successive items from LIST while (PRED item) returns a non-nil value.
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-take-while #[514 "\300\301\302\203,\203,@!\204\300\262\202 \211B\262\210\211T\262A\262\202\266\211\237\207" [nil t 0] 9 (#$ . 31690)])
2019-10-27 20:23:01 +01:00
#@50 Anaphoric form of `-drop-while'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--drop-while '(macro . #[514 "\300\301!\302DC\303\304\302\305\306DDC EE\307DEF\207" [make-symbol "list" let while and it car !cdr] 12 (#$ . 31971)]))
2019-10-27 20:23:01 +01:00
(put '--drop-while 'edebug-form-spec '(form form))
#@105 Return the tail of LIST starting from the first item for which (PRED item) returns nil.
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-drop-while #[514 "\211\211\203\211@!\262\203\211A\262\202\211\207" [] 6 (#$ . 32247)])
2019-10-27 20:23:01 +01:00
#@107 Return a list of ((-take N LIST) (-drop N LIST)), in no more than one pass through the list.
(fn N LIST)
2019-12-01 19:55:19 +01:00
(defalias '-split-at #[514 "\300\301\211W\203\203@B\262A\262\211T\262\202\266\211\237D\207" [nil 0] 7 (#$ . 32467)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -split-at pure t side-effect-free] 5)
#@116 Rotate LIST N places to the right. With N negative, rotate to the left.
The time complexity is O(n).
(fn N LIST)
2019-12-01 19:55:19 +01:00
(defalias '-rotate #[514 "\211\205\211G\300\"Z\301\302\"\303\"\"\266\203\207" [mod append -drop -take] 10 (#$ . 32822)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -rotate pure t side-effect-free] 5)
#@108 Return a list with X inserted into LIST at position N.
See also: `-splice', `-splice-list'
(fn N X LIST)
2019-12-01 19:55:19 +01:00
(defalias '-insert-at #[771 "\300\"\211@A@B\244\207" [-split-at] 7 (#$ . 33183)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -insert-at pure t side-effect-free] 5)
#@106 Return a list with element at Nth position in LIST replaced with X.
See also: `-replace'
(fn N X LIST)
2019-12-01 19:55:19 +01:00
(defalias '-replace-at #[771 "\300\"\211@A@AB\244\207" [-split-at] 7 (#$ . 33492)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -replace-at pure t side-effect-free] 5)
#@130 Return a list with element at Nth position in LIST replaced with `(func (nth n list))`.
See also: `-map-when'
(fn N FUNC LIST)
2019-12-01 19:55:19 +01:00
(defalias '-update-at #[771 "\300\"\211@A@@!A@AB\244\207" [-split-at] 7 (#$ . 33802)])
2019-10-27 20:23:01 +01:00
#@54 Anaphoric version of `-update-at'.
(fn N FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--update-at '(macro . #[771 "\300\301\302EF\207" [-update-at lambda (it)] 8 (#$ . 34029)]))
2019-10-27 20:23:01 +01:00
(put '--update-at 'edebug-form-spec '(form form form))
#@117 Return a list with element at Nth position in LIST removed.
See also: `-remove-at-indices', `-remove'
(fn N LIST)
2019-12-01 19:55:19 +01:00
(defalias '-remove-at #[514 "\300C\"\207" [-remove-at-indices] 5 (#$ . 34250)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -remove-at pure t side-effect-free] 5)
#@175 Return a list whose elements are elements from LIST without
elements selected as `(nth i list)` for all i
from INDICES.
See also: `-remove-at', `-remove'
(fn INDICES LIST)
2019-12-01 19:55:19 +01:00
(defalias '-remove-at-indices #[514 "\300\301\"\211@\302\303\304\305A#\"B\306\307\2038@\310\"\211@B\262\211A@A\262\266\211T\262A\262\202\266B\262\311\312\237\"\207" [-sort < -map 1- -zip-with - nil 0 -split-at apply -concat] 11 (#$ . 34564)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -remove-at-indices pure t side-effect-free] 5)
#@50 Anaphoric form of `-split-with'.
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '--split-with '(macro . #[514 "\300\301!\300\302!\300\303!\304D\305B\306BE\307\310E\304\311\312 DDC\313\314\fD\315 \316BB\317\311\fE\320 D\257EE\321\322DEF\207" [make-symbol "list" "result" "continue" let (nil) (t) while and it car if not setq (nil) !cons !cdr list nreverse] 17 (#$ . 35129)]))
2019-10-27 20:23:01 +01:00
(put '--split-with 'edebug-form-spec '(form form))
#@128 Return a list of ((-take-while PRED LIST) (-drop-while PRED LIST)), in no more than one pass through the list.
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-split-with #[514 "\211\300\301\203&\211\203&@!\204\300\262\202\"\211B\262A\262\210\202\237D\207" [nil t] 8 (#$ . 35558)])
2019-10-27 20:23:01 +01:00
#@224 Split the LIST each time ITEM is found.
Unlike `-partition-by', the ITEM is discarded from the results.
Empty lists are also removed from the result.
Comparison is done by `equal'.
See also `-split-when'
(fn ITEM LIST)
2019-12-01 19:55:19 +01:00
(defalias '-split-on '(macro . #[514 "\300\301\302\303\304EEE\207" [-split-when lambda (it) equal it] 8 (#$ . 35844)]))
2019-10-27 20:23:01 +01:00
(put '-split-on 'edebug-form-spec '(form form))
#@53 Anaphoric version of `-split-when'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--split-when '(macro . #[514 "\300\301\302EE\207" [-split-when lambda (it)] 6 (#$ . 36244)]))
2019-10-27 20:23:01 +01:00
(put '--split-when 'edebug-form-spec '(form form))
#@269 Split the LIST on each element where FN returns non-nil.
Unlike `-partition-by', the "matched" element is discarded from
the results. Empty lists are also removed from the result.
This function can be thought of as a generalization of
`split-string'.
(fn FN LIST)
2019-12-01 19:55:19 +01:00
(defalias '-split-when #[514 "\300\211\203*@!\204@B\262\202#\211\203 \211\237B\262\300\262A\262\202\211\2034\211\237B\262\237\207" [nil] 6 (#$ . 36461)])
2019-10-27 20:23:01 +01:00
#@48 Anaphoric form of `-separate'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--separate '(macro . #[514 "\300\301!\300\302!\303D\304\305\306\307 E\306\307 EFE\310\311D\311DEF\207" [make-symbol "yes" "no" let --each if !cons it list nreverse] 14 (#$ . 36911)]))
2019-10-27 20:23:01 +01:00
(put '--separate 'edebug-form-spec '(form form))
#@107 Return a list of ((-filter PRED LIST) (-remove PRED LIST)), in one pass through the list.
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-separate #[514 "\300\211\301\203*@!\203\211B\262\202\211B\262\210\211T\262A\262\202\266\237\237D\207" [nil 0] 9 (#$ . 37220)])
2019-10-27 20:23:01 +01:00
#@85 Private: Used by -partition-all-in-steps and -partition-in-steps.
(fn N STEP LIST)
2019-12-01 19:55:19 +01:00
(defalias '---partition-all-in-steps-reversed #[771 "\300W\203\n\301\302!\210\303\203 \304\"B\262\305\"\262\202 \211\207" [1 error "Step must be a positive number, or you're looking at some juicy infinite loops." nil -take -drop] 7 (#$ . 37494)])
2019-10-27 20:23:01 +01:00
#@160 Return a new list with the items in LIST grouped into N-sized sublists at offsets STEP apart.
The last groups may contain less than N items.
(fn N STEP LIST)
2019-12-01 19:55:19 +01:00
(defalias '-partition-all-in-steps #[771 "\300#\237\207" [---partition-all-in-steps-reversed] 7 (#$ . 37844)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -partition-all-in-steps pure t side-effect-free] 5)
#@202 Return a new list with the items in LIST grouped into N-sized sublists at offsets STEP apart.
If there are not enough items to make the last group N-sized,
those items are discarded.
(fn N STEP LIST)
2019-12-01 19:55:19 +01:00
(defalias '-partition-in-steps #[771 "\300#\211\203\211@GW\203\211A\262\202\211\237\207" [---partition-all-in-steps-reversed] 7 (#$ . 38246)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -partition-in-steps pure t side-effect-free] 5)
#@132 Return a new list with the items in LIST grouped into N-sized sublists.
The last group may contain less than N items.
(fn N LIST)
2019-12-01 19:55:19 +01:00
(defalias '-partition-all #[514 "\300\211#\207" [-partition-all-in-steps] 6 (#$ . 38726)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -partition-all pure t side-effect-free] 5)
#@175 Return a new list with the items in LIST grouped into N-sized sublists.
If there are not enough items to make the last group N-sized,
those items are discarded.
(fn N LIST)
2019-12-01 19:55:19 +01:00
(defalias '-partition #[514 "\300\211#\207" [-partition-in-steps] 6 (#$ . 39070)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -partition pure t side-effect-free] 5)
#@52 Anaphoric form of `-partition-by'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--partition-by '(macro . #[514 "\300\301!\300\302!\300\303!\300\304!\300\305!\306DC\307\310 \311B\312\313DD\n\314B\nD \315 DD\257\316\310\312\313 DD DD\317\320E\321\322DE\323\324BB\323E\257\321\312E\325 D\257E\321\322\fD E\322 D\257EE\207" [make-symbol "result" "sublist" "value" "new-value" "list" let when let* (nil) it car ((list it)) cdr while unless equal !cons nreverse setq (nil) !cdr] 24 (#$ . 39444)]))
2019-10-27 20:23:01 +01:00
(put '--partition-by 'edebug-form-spec '(form form))
#@93 Apply FN to each item in LIST, splitting it each time FN returns a new value.
(fn FN LIST)
2019-12-01 19:55:19 +01:00
(defalias '-partition-by #[514 "\211\211\205B\300@\211C!A\211\2038\211@!\232\204,\237B\262\300\262\211\262B\262A\266\203\202\237B\262\237\266\205\207" [nil] 12 (#$ . 40020)])
2019-10-27 20:23:01 +01:00
#@59 Anaphoric form of `-partition-by-header'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--partition-by-header '(macro . #[514 "\300\301!\300\302!\300\303!\300\304!\300\305!\300\306!\307DC\310\311\n\312B\313\314DD \315B D \316B\n\317\fDD\257\320\311\313\314 DD DD\321\322E\310\323\324DE\325\326BB\325\327BB\257\325\330BBF\323\313E\331 D\257E\323\324 DE\324D\257EE\207" [make-symbol "result" "sublist" "header-value" "seen-body?" "new-value" "list" let when let* (nil) it car ((list it)) (nil) cdr while if equal !cons nreverse setq (nil) (nil) (t) !cdr] 27 (#$ . 40321)]))
2019-10-27 20:23:01 +01:00
(put '--partition-by-header 'edebug-form-spec '(form form))
#@219 Apply FN to the first item in LIST. That is the header
value. Apply FN to each item in LIST, splitting it each time FN
returns the header value, but only after seeing at least one
other value (the body).
(fn FN LIST)
2019-12-01 19:55:19 +01:00
(defalias '-partition-by-header #[514 "\211\211\205O\300@\211C!\300A\211\203D\211@ !\232\2034\2037\237B\262\300\262\300\262\2027\301\262B\262A\266\203\202\237B\262\237\266\206\207" [nil t] 13 (#$ . 40989)])
2019-10-27 20:23:01 +01:00
#@88 Partition directly after each time PRED is true on an element of LIST.
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-partition-after-pred #[514 "\211\205\"\300A\"@!\203@CB\202 @@BAB\262\207" [-partition-after-pred] 5 (#$ . 41453)])
2019-10-27 20:23:01 +01:00
#@89 Partition directly before each time PRED is true on an element of LIST.
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-partition-before-pred #[514 "\300\301\302\301!\"\"\237\207" [-map reverse -partition-after-pred] 8 (#$ . 41687)])
2019-10-27 20:23:01 +01:00
#@74 Partition directly after each time ITEM appears in LIST.
(fn ITEM LIST)
2019-12-01 19:55:19 +01:00
(defalias '-partition-after-item #[514 "\300\301\302\303\304\305!\306\"\307\310%\"\207" [-partition-after-pred make-byte-code 257 "\211\300\232\207" vconcat vector [] 3 "\n\n(fn ELE)"] 9 (#$ . 41909)])
2019-10-27 20:23:01 +01:00
#@75 Partition directly before each time ITEM appears in LIST.
(fn ITEM LIST)
2019-12-01 19:55:19 +01:00
(defalias '-partition-before-item #[514 "\300\301\302\303\304\305!\306\"\307\310%\"\207" [-partition-before-pred make-byte-code 257 "\211\300\232\207" vconcat vector [] 3 "\n\n(fn ELE)"] 9 (#$ . 42193)])
2019-10-27 20:23:01 +01:00
#@48 Anaphoric form of `-group-by'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--group-by '(macro . #[514 "\300\301!\300\302!\300\303!\304\305\306C\307\310D\304\311\nDDEE\312\313\nD\314 \315BBDD\316\317 \307\320\311 DEE\321\322\f\323BB\324BBF\325BBB\326 FED\207" [make-symbol "n" "k" "grp" nreverse -map lambda cons car cdr --reduce-from let* assoc (acc) if setcdr it push list (it) (acc) (acc) nil] 19 (#$ . 42480)]))
2019-10-27 20:23:01 +01:00
(put '--group-by 'edebug-form-spec t)
#@125 Separate LIST into an alist whose keys are FN applied to the
elements of LIST. Keys are compared by `equal'.
(fn FN LIST)
2019-12-01 19:55:19 +01:00
(defalias '-group-by #[514 "\300\301\302\303\203;@!\304\"\211\203\"\211AB\241\210\202*DB\262\266\202\262\210\211T\262A\262\202\266\211\262\"\237\207" [-map #[257 "\211@A\237B\207" [] 3 "\n\n(fn N)"] nil 0 assoc] 13 (#$ . 42939)])
2019-10-27 20:23:01 +01:00
#@76 Return a new list of all elements in LIST separated by SEP.
(fn SEP LIST)
2019-12-01 19:55:19 +01:00
(defalias '-interpose #[514 "\300\203@B\262A\262\203\"@BB\262A\262\202\211\237\207" [nil] 6 (#$ . 43328)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -interpose pure t side-effect-free] 5)
#@90 Return a new list of the first item in each list, then the second etc.
(fn &rest LISTS)
2019-12-01 19:55:19 +01:00
(defalias '-interleave #[128 "\211\2055\300\301\302\"\2031\303\203&@\211@B\262\210\211T\262A\262\202\266\304\305\"\262\202\211\237\262\207" [nil -none\? null 0 -map cdr] 7 (#$ . 43643)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -interleave pure t side-effect-free] 5)
#@145 Anaphoric form of `-zip-with'.
The elements in list1 are bound as symbol `it', the elements in list2 as symbol `other'.
(fn FORM LIST1 LIST2)
2019-12-01 19:55:19 +01:00
(defalias '--zip-with '(macro . #[771 "\300\301!\300\302!\300\303!\304\305BDDE\306\307E\304\310\311DD\312\311DDD\313\f\nE\314 D\314 D\257E\315DF\207" [make-symbol "result" "list1" "list2" let (nil) while and it car other !cons !cdr nreverse] 16 (#$ . 44056)]))
2019-10-27 20:23:01 +01:00
(put '--zip-with 'edebug-form-spec '(form form form))
#@347 Zip the two lists LIST1 and LIST2 using a function FN. This
function is applied pairwise taking as first argument element of
LIST1 and as second argument element of LIST2 at corresponding
position.
The anaphoric form `--zip-with' binds the elements from LIST1 as symbol `it',
and the elements from LIST2 as symbol `other'.
(fn FN LIST1 LIST2)
2019-12-01 19:55:19 +01:00
(defalias '-zip-with #[771 "\300\203#\211\203#@@\"B\262A\262A\266\203\202\237\207" [nil] 11 (#$ . 44542)])
#@567 Zip LISTS together. Group the head of each list, followed by the
2019-10-27 20:23:01 +01:00
second elements of each list, and so on. The lengths of the returned
groupings are equal to the length of the shortest input list.
If two lists are provided as arguments, return the groupings as a list
of cons cells. Otherwise, return the groupings as a list of lists.
Please note! This distinction is being removed in an upcoming 3.0
2019-12-01 19:55:19 +01:00
release of Dash. If you rely on this behavior, use `-zip-pair` instead,
which will retain that behaviour in future versions.
Alias: `-zip-pair'
2019-10-27 20:23:01 +01:00
(fn &rest LISTS)
2019-12-01 19:55:19 +01:00
(defalias '-zip #[128 "\211\2052\300\301\302\"\203\303\304\"B\262\303\305\"\262\202\211\237\262G\306U\203/\303\307\"\2020\211\262\207" [nil -none\? null mapcar car cdr 2 #[257 "\211@A@B\207" [] 3 "\n\n(fn IT)"]] 5 (#$ . 45021)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\305\306\301\"\207" [function-put -zip pure t side-effect-free defalias -zip-pair] 5)
#@177 Zip LISTS, with FILL-VALUE padded onto the shorter lists. The
lengths of the returned groupings are equal to the length of the
longest input list.
(fn FILL-VALUE &rest LISTS)
2019-12-01 19:55:19 +01:00
(defalias '-zip-fill #[385 "\300\301\300\302B\"\"\207" [apply -zip -pad] 8 (#$ . 45973)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -zip-fill pure t side-effect-free] 5)
#@241 Unzip LISTS.
This works just like `-zip' but takes a list of lists instead of
a variable number of arguments, such that
(-unzip (-zip L1 L2 L3 ...))
is identity (given that the lists are the same length).
See also: `-zip'
(fn LISTS)
2019-12-01 19:55:19 +01:00
(defalias '-unzip #[257 "\300\301\"\207" [apply -zip] 4 (#$ . 46356)])
2019-10-27 20:23:01 +01:00
#@112 Return an infinite copy of LIST that will cycle through the
elements and repeat from the beginning.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-cycle #[257 "\300\301\"\211\244\207" [-map identity] 4 (#$ . 46675)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -cycle pure t side-effect-free] 5)
#@128 Appends FILL-VALUE to the end of each list in LISTS such that they
will all have the same length.
(fn FILL-VALUE &rest LISTS)
2019-12-01 19:55:19 +01:00
(defalias '-pad #[385 "\300\301\"\302\303\304\"!\305\306\307\310\311\312 \"\313\"\314\315%\"\207" [-annotate length -max -map car mapcar make-byte-code 257 "\302A\303\301@Z\300\"\"\207" vconcat vector [append -repeat] 6 "\n\n(fn IT)"] 12 (#$ . 46982)])
2019-10-27 20:23:01 +01:00
#@141 Return a list of cons cells where each cell is FN applied to each
element of LIST paired with the unmodified element of LIST.
(fn FN LIST)
2019-12-01 19:55:19 +01:00
(defalias '-annotate #[514 "\300\301\"\"\207" [-zip -map] 6 (#$ . 47377)])
2019-10-27 20:23:01 +01:00
#@51 Anaphoric version of `-annotate'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--annotate '(macro . #[514 "\300\301\302EE\207" [-annotate lambda (it)] 6 (#$ . 47601)]))
2019-10-27 20:23:01 +01:00
(put '--annotate 'edebug-form-spec '(form form))
#@140 Helper for `-table' and `-table-flat'.
If a list overflows, carry to the right and reset the list.
(fn LISTS RESTORE-LISTS &optional RE)
2019-12-01 19:55:19 +01:00
(defalias 'dash--table-carry #[770 "@\206\300\232?\205C@\240\210\211A@\211AA\240\210\266A\262A\262\211\203\211@\237\211AA@B\240\266\211\301\240\210\211A\262\202\207" [(nil) nil] 8 (#$ . 47810)])
2019-10-27 20:23:01 +01:00
#@352 Compute outer product of LISTS using function FN.
The function FN should have the same arity as the number of
supplied lists.
The outer product is computed by applying fn to all possible
combinations created by taking one element from each list in
order. The dimension of the result is (length lists).
See also: `-table-flat'
(fn FN &rest LISTS)
2019-12-01 19:55:19 +01:00
(defalias '-table #[385 "\300!\301!\302G\303\"@\2031\304\305\306\"\"\211@B\240\266\211@A\240\210\307#\266\202 \301!@\237\207" [copy-sequence last make-list nil apply -map car dash--table-carry] 10 (#$ . 48175)])
2019-10-27 20:23:01 +01:00
#@539 Compute flat outer product of LISTS using function FN.
The function FN should have the same arity as the number of
supplied lists.
The outer product is computed by applying fn to all possible
combinations created by taking one element from each list in
order. The results are flattened, ignoring the tensor structure
of the result. This is equivalent to calling:
(-flatten-n (1- (length lists)) (apply \='-table fn lists))
but the implementation here is much more efficient.
See also: `-flatten-n', `-table'
(fn FN &rest LISTS)
2019-12-01 19:55:19 +01:00
(defalias '-table-flat #[385 "\300!\301!\302@\203(\303\304\305\"\"\211B\262\211@A\240\210\306\"\266\202\211\237\207" [copy-sequence last nil apply -map car dash--table-carry] 10 (#$ . 48764)])
2019-10-27 20:23:01 +01:00
#@234 Take a function FN and fewer than the normal arguments to FN,
and return a fn that takes a variable number of additional ARGS.
When called, the returned function calls FN with ARGS first and
then additional args.
(fn FN &rest ARGS)
2019-12-01 19:55:19 +01:00
(defalias '-partial #[385 "\300\301#\207" [apply apply-partially] 6 (#$ . 49517)])
2019-10-27 20:23:01 +01:00
#@151 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.
(fn ELEM LIST)
2019-12-01 19:55:19 +01:00
(defalias '-elem-index #[514 "\300\"@\207" [-elem-indices] 5 (#$ . 49842)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -elem-index pure t side-effect-free] 5)
#@113 Return the indices of all elements in LIST equal to the query
element ELEM, in ascending order.
(fn ELEM LIST)
2019-12-01 19:55:19 +01:00
(defalias '-elem-indices #[514 "\300\301\302\"\"\207" [-find-indices -partial equal] 6 (#$ . 50187)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -elem-indices pure t side-effect-free] 5)
#@111 Return the indices of all elements in LIST satisfying the
predicate PRED, in ascending order.
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-find-indices #[514 "\300\301\302\303\203$@!\205CB\262\210\211T\262A\262\202\266\211\237\262\"\207" [apply append nil 0] 10 (#$ . 50522)])
2019-10-27 20:23:01 +01:00
#@55 Anaphoric version of `-find-indices'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--find-indices '(macro . #[514 "\300\301\302EE\207" [-find-indices lambda (it)] 6 (#$ . 50807)]))
2019-10-27 20:23:01 +01:00
(put '--find-indices 'edebug-form-spec '(form form))
#@186 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.
See also `-first'.
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-find-index #[514 "\300\"@\207" [-find-indices] 5 (#$ . 51032)])
2019-10-27 20:23:01 +01:00
#@53 Anaphoric version of `-find-index'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--find-index '(macro . #[514 "\300\301\302EE\207" [-find-index lambda (it)] 6 (#$ . 51301)]))
2019-10-27 20:23:01 +01:00
(put '--find-index 'edebug-form-spec '(form form))
#@184 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 `-last'.
(fn PRED LIST)
2019-12-01 19:55:19 +01:00
(defalias '-find-last-index #[514 "\300\301\"!\207" [-last-item -find-indices] 6 (#$ . 51518)])
2019-10-27 20:23:01 +01:00
#@58 Anaphoric version of `-find-last-index'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--find-last-index '(macro . #[514 "\300\301\302EE\207" [-find-last-index lambda (it)] 6 (#$ . 51805)]))
2019-10-27 20:23:01 +01:00
#@123 Return a list whose elements are elements from LIST selected
as `(nth i list)` for all i from INDICES.
(fn INDICES LIST)
2019-12-01 19:55:19 +01:00
(defalias '-select-by-indices #[514 "\300\301\203@\2118B\262\210\211T\262A\262\202\266\211\237\207" [nil 0] 8 (#$ . 51986)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -select-by-indices pure t side-effect-free] 5)
#@283 Select COLUMNS from TABLE.
TABLE is a list of lists where each element represents one row.
It is assumed each row has the same length.
Each row is transformed such that only the specified COLUMNS are
selected.
See also: `-select-column', `-select-by-indices'
(fn COLUMNS TABLE)
2019-12-01 19:55:19 +01:00
(defalias '-select-columns #[514 "\300\301\302\303\304\305!\306\"\307\310%\"\207" [mapcar make-byte-code 257 "\301\300\"\207" vconcat vector [-select-by-indices] 4 "\n\n(fn IT)"] 9 (#$ . 52371)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -select-columns pure t side-effect-free] 5)
#@257 Select COLUMN from TABLE.
TABLE is a list of lists where each element represents one row.
It is assumed each row has the same length.
The single selected column is returned as a list.
See also: `-select-columns', `-select-by-indices'
(fn COLUMN TABLE)
2019-12-01 19:55:19 +01:00
(defalias '-select-column #[514 "\300\301\302\303\304\305\306\307 !\310\"\311\312%\"\"\207" [apply append mapcar make-byte-code 257 "\301\300C\"\207" vconcat vector [-select-by-indices] 4 "\n\n(fn IT)"] 11 (#$ . 52974)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -select-column pure t side-effect-free] 5)
#@253 Thread the expr through the forms. Insert X as the second item
in the first form, making a list of it if it is not a list
already. If there are more forms, insert the first form as the
second item in second form, etc.
(fn X &optional FORM &rest MORE)
2019-12-01 19:55:19 +01:00
(defalias '-> '(macro . #[641 "\204\207\211\204<\203@ABB\207D\207\300\211EBB\207" [->] 7 (#$ . 53574)]))
2019-10-27 20:23:01 +01:00
(put '-> 'edebug-form-spec '(form &rest [&or symbolp (sexp &rest form)]))
#@249 Thread the expr through the forms. Insert X as the last item
in the first form, making a list of it if it is not a list
already. If there are more forms, insert the first form as the
last item in second form, etc.
(fn X &optional FORM &rest MORE)
2019-12-01 19:55:19 +01:00
(defalias '->> '(macro . #[641 "\204\207\211\204<\203\300C\"\207D\207\301\211EBB\207" [append ->>] 7 (#$ . 54029)]))
2019-10-27 20:23:01 +01:00
(put '->> 'edebug-form-spec '->)
#@269 Starting with the value of X, thread each expression through FORMS.
Insert X at the position signified by the symbol `it' in the first
form. If there are more forms, insert the first form at the position
signified by `it' in in second form, etc.
(fn X &rest FORMS)
2019-12-01 19:55:19 +01:00
(defalias '--> '(macro . #[385 "\300\301BBB\207" [-as-> it] 6 (#$ . 54450)]))
2019-10-27 20:23:01 +01:00
(put '--> 'edebug-form-spec '(form body))
#@212 Starting with VALUE, thread VARIABLE through FORMS.
In the first form, bind VARIABLE to VALUE. In the second form, bind
VARIABLE to the result of the first form, and so forth.
(fn VALUE VARIABLE &rest FORMS)
2019-12-01 19:55:19 +01:00
(defalias '-as-> '(macro . #[642 "\211\204\207\300DC\301@9\203@D\202@ABBBE\207" [let -as->] 9 (#$ . 54847)]))
2019-10-27 20:23:01 +01:00
(put '-as-> 'edebug-form-spec '(form symbolp body))
#@163 When expr is non-nil, thread it through the first form (via `->'),
and when that result is non-nil, through the next form, etc.
(fn X &optional FORM &rest MORE)
2019-12-01 19:55:19 +01:00
(defalias '-some-> '(macro . #[641 "\204\207\300\301!\302\303D\304EEBB\207" [make-symbol "result" -some-> -when-let ->] 10 (#$ . 55242)]))
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put -some-> edebug-form-spec -> function-put lisp-indent-function 1] 4)
2019-10-27 20:23:01 +01:00
#@164 When expr is non-nil, thread it through the first form (via `->>'),
and when that result is non-nil, through the next form, etc.
(fn X &optional FORM &rest MORE)
2019-12-01 19:55:19 +01:00
(defalias '-some->> '(macro . #[641 "\204\207\300\301!\302\303D\304EEBB\207" [make-symbol "result" -some->> -when-let ->>] 10 (#$ . 55694)]))
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put -some->> edebug-form-spec -> function-put lisp-indent-function 1] 4)
2019-10-27 20:23:01 +01:00
#@164 When expr in non-nil, thread it through the first form (via `-->'),
and when that result is non-nil, through the next form, etc.
(fn X &optional FORM &rest MORE)
2019-12-01 19:55:19 +01:00
(defalias '-some--> '(macro . #[641 "\204\207\300\301!\302\303D\304EEBB\207" [make-symbol "result" -some--> -when-let -->] 10 (#$ . 56151)]))
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put -some--> edebug-form-spec -> function-put lisp-indent-function 1] 4)
2019-10-27 20:23:01 +01:00
#@176 Grade elements of LIST using COMPARATOR relation, yielding a
permutation vector such that applying this permutation to LIST
sorts it in ascending order.
(fn COMPARATOR LIST)
2019-12-01 19:55:19 +01:00
(defalias '-grade-up #[514 "\300\301\302\303D\304BBE\305\306\307\310\311\203+@\211BB\262\210\211T\262A\262\202\266\211\237\262\"\"\207" [lambda (it other) funcall quote ((car it) (car other)) -map cdr -sort nil 0] 13 (#$ . 56608)])
2019-10-27 20:23:01 +01:00
#@177 Grade elements of LIST using COMPARATOR relation, yielding a
permutation vector such that applying this permutation to LIST
sorts it in descending order.
(fn COMPARATOR LIST)
2019-12-01 19:55:19 +01:00
(defalias '-grade-down #[514 "\300\301\302\303D\304BBE\305\306\307\310\311\203+@\211BB\262\210\211T\262A\262\202\266\211\237\262\"\"\207" [lambda (it other) funcall quote ((car other) (car it)) -map cdr -sort nil 0] 13 (#$ . 57039)])
2019-10-27 20:23:01 +01:00
#@42 Monotonic counter for generated symbols.
2019-12-01 19:55:19 +01:00
(defvar dash--source-counter 0 (#$ . 57472))
2019-10-27 20:23:01 +01:00
#@87 Generate a new dash-source symbol.
All returned symbols are guaranteed to be unique.
2019-12-01 19:55:19 +01:00
(defalias 'dash--match-make-source-symbol #[0 "\301\302\303\"!T\207" [dash--source-counter make-symbol format "--dash-source-%d--"] 4 (#$ . 57564)])
2019-10-27 20:23:01 +01:00
#@70 Return non-nil if SYMBOL is a symbol and starts with _.
(fn SYMBOL)
2019-12-01 19:55:19 +01:00
(defalias 'dash--match-ignore-place-p #[257 "\2119\205\f\300!\301H\302=\207" [symbol-name 0 95] 3 (#$ . 57808)])
2019-10-27 20:23:01 +01:00
#@75 Helper function generating idiomatic shifting code.
(fn SKIP-CDR SOURCE)
2019-12-01 19:55:19 +01:00
(defalias 'dash--match-cons-skip-cdr #[514 "\300U\203\n\301D\207\302\303\"\304\305T\"EE\207" [0 pop prog1 dash--match-cons-get-car setq dash--match-cons-get-cdr] 9 (#$ . 57998)])
2019-10-27 20:23:01 +01:00
#@81 Helper function generating idiomatic code to get nth car.
(fn SKIP-CDR SOURCE)
2019-12-01 19:55:19 +01:00
(defalias 'dash--match-cons-get-car #[514 "\300U\203\n\301D\207\302U\203\303D\207\304E\207" [0 car 1 cadr nth] 5 (#$ . 58267)])
2019-10-27 20:23:01 +01:00
#@81 Helper function generating idiomatic code to get nth cdr.
(fn SKIP-CDR SOURCE)
2019-12-01 19:55:19 +01:00
(defalias 'dash--match-cons-get-cdr #[514 "\300U\203\207\301U\203\302D\207\303E\207" [0 1 cdr nthcdr] 5 (#$ . 58490)])
2019-10-27 20:23:01 +01:00
#@86 Setup a cons matching environment and call the real matcher.
(fn MATCH-FORM SOURCE)
2019-12-01 19:55:19 +01:00
(defalias 'dash--match-cons #[514 "\300 \301\211:\203\302@!\203T\262\211A\262\202\211:\2031\211A\2041\303@\304\"\"\202K\301V\203B\303\305\"\"\202KD\306\"B\207" [dash--match-make-source-symbol 0 dash--match-ignore-place-p dash--match dash--match-cons-get-car dash--match-cons-get-cdr dash--match-cons-1] 10 (#$ . 58704)])
2019-10-27 20:23:01 +01:00
#@47 Get expand function name for TYPE.
(fn TYPE)
2019-12-01 19:55:19 +01:00
(defalias 'dash--get-expand-function #[257 "\300\301\302\"!\207" [intern-soft format "dash-expand:%s"] 5 (#$ . 59146)])
2019-10-27 20:23:01 +01:00
#@386 Match MATCH-FORM against SOURCE.
MATCH-FORM is a proper or improper list. Each element of
MATCH-FORM is either a symbol, which gets bound to the respective
value in source or another match form which gets destructured
recursively.
If the cdr of last cons cell in the list is `nil', matching stops
there.
SOURCE is a proper or improper list.
(fn MATCH-FORM SOURCE &optional PROPS)
2019-12-01 19:55:19 +01:00
(defalias 'dash--match-cons-1 #[770 "\300\301\"\206\302:\203eA\203Y@9\203.\303\304@!!\203.\305\306!\307\"\"\202w\310@!\203D\311A\312\301T##\202w\313\314@\315\"\"\311A\"\"\202w\314@\316\"\"\202w\317=\203o\317\202w\314\307\"\"\207" [plist-get :skip-cdr 0 functionp dash--get-expand-function dash--match-kv dash--match-kv-normalize-match-form dash--match-cons-get-cdr dash--match-ignore-place-p dash--match-cons-1 plist-put -concat dash--match dash--match-cons-skip-cdr dash--match-cons-get-car nil] 11 (#$ . 59320)])
2019-10-27 20:23:01 +01:00
#@59 Return the tail of SEQ starting at START.
(fn SEQ START)
2019-12-01 19:55:19 +01:00
(defalias 'dash--vector-tail #[514 "\300!\203+GZ\301\302\"\302\211W\203(\\HI\210\211T\262\202\266\207;\2054\303O\207" [vectorp make-vector 0 nil] 11 (#$ . 60271)])
2019-10-27 20:23:01 +01:00
#@88 Setup a vector matching environment and call the real matcher.
(fn MATCH-FORM SOURCE)
2019-12-01 19:55:19 +01:00
(defalias 'dash--match-vector #[514 "\300 G\301U\203\302\303H\304\305BB\"\202Q9\203\"\306\"\202Q\307\310\"\311\312\"G\211GSU\205D\313\312\"\302H\304E\"\262\266\202\206Q\211D\306\"B\207" [dash--match-make-source-symbol 1 dash--match 0 aref (0) dash--match-vector-1 mapcar dash--match-ignore-place-p -remove null -find-index] 11 (#$ . 60522)])
2019-10-27 20:23:01 +01:00
#@691 Match MATCH-FORM against SOURCE.
MATCH-FORM is a vector. Each element of MATCH-FORM is either a
symbol, which gets bound to the respective value in source or
another match form which gets destructured recursively.
If second-from-last place in MATCH-FORM is the symbol &rest, the
next element of the MATCH-FORM is matched against the tail of
SOURCE, starting at index of the &rest symbol. This is
conceptually the same as the (head . tail) match for improper
lists, where dot plays the role of &rest.
SOURCE is a vector.
If the MATCH-FORM vector is shorter than SOURCE vector, only
the (length MATCH-FORM) places are bound, the rest of the SOURCE
is discarded.
(fn MATCH-FORM SOURCE)
2019-12-01 19:55:19 +01:00
(defalias 'dash--match-vector-1 #[514 "\300G\301W\203aH\2119\203+\211\302=\203+\303TH\304E\"\262\202U\2119\203F\305!\300H\306=\204F\211\307EDC\202U\2119?\205U\303\307E\"B\262T\262\210\202\310\311\237\"\207" [0 nil &rest dash--match dash--vector-tail symbol-name 95 aref -flatten-n 1] 11 (#$ . 60985)])
2019-10-27 20:23:01 +01:00
#@148 Normalize kv PATTERN.
This method normalizes PATTERN to the format expected by
`dash--match-kv'. See `-let' for the specification.
(fn PATTERN)
2019-12-01 19:55:19 +01:00
(defalias 'dash--match-kv-normalize-match-form #[257 "\211@CC\300C\301\302!\303\304\305\306A AA#\"\307\310\311\312\313   #\314\"\315\316%\"\210\242\237\207" [nil make-symbol "--dash-fill-placeholder--" -each apply -zip -pad make-byte-code 257 "\211@A\301\242\203\301\303\240\202\260\302=\204>\2119\203,\304!\204,\211\305=\204,\211\303=\203\237\211:\2038\211@\306=\203\237\307!\204\237\304!\203\\\300\300\242B\240\210\300\310\311!\312\303O!\300\242B\240\210\202\231;\203t\300\300\242B\240\210\300\310!\300\242B\240\210\202\231:\203\223@\306=\203\223\300\300\242B\240\210\300A@\300\242B\240\210\202\231\313\314#\210\301\303\240\202\260\300\300\242B\240\210\300\300\242B\240\210\301\305\240\207" vconcat vector [nil keywordp t quote vectorp intern symbol-name 1 error "-let: found key `%s' in kv destructuring but its pattern `%s' is invalid and can not be derived from the key"] 8 "\n\n(fn PAIR)"] 14 (#$ . 62023)])
2019-10-27 20:23:01 +01:00
#@152 Setup a kv matching environment and call the real matcher.
kv can be any key-value store, such as plist, alist or hash-table.
(fn MATCH-FORM SOURCE)
2019-12-01 19:55:19 +01:00
(defalias 'dash--match-kv #[514 "\300 G\301U\203\302A@#\202.9\203\"\302A@#\202.\211D\302A@#B\207" [dash--match-make-source-symbol 3 dash--match-kv-1] 8 (#$ . 63136)])
2019-10-27 20:23:01 +01:00
#@79 Generate extracting KEY from SOURCE for &hash destructuring.
(fn KEY SOURCE)
2019-12-01 19:55:19 +01:00
(defalias 'dash-expand:&hash #[514 "\300E\207" [gethash] 5 (#$ . 63478)])
2019-10-27 20:23:01 +01:00
#@80 Generate extracting KEY from SOURCE for &plist destructuring.
(fn KEY SOURCE)
2019-12-01 19:55:19 +01:00
(defalias 'dash-expand:&plist #[514 "\300E\207" [plist-get] 5 (#$ . 63638)])
2019-10-27 20:23:01 +01:00
#@80 Generate extracting KEY from SOURCE for &alist destructuring.
(fn KEY SOURCE)
2019-12-01 19:55:19 +01:00
(defalias 'dash-expand:&alist #[514 "\300\301ED\207" [cdr assoc] 6 (#$ . 63802)])
2019-10-27 20:23:01 +01:00
#@135 Generate extracting KEY from SOURCE for &hash? destructuring.
Similar to &hash but check whether the map is not nil.
(fn KEY SOURCE)
2019-12-01 19:55:19 +01:00
(defalias 'dash-expand:&hash\? #[514 "\300\301!\302DC\303\304EEE\207" [make-symbol "src" let when gethash] 10 (#$ . 63972)])
2019-10-27 20:23:01 +01:00
(defalias 'dash-expand:&keys 'dash-expand:&plist)
#@509 Match MATCH-FORM against SOURCE of type TYPE.
MATCH-FORM is a proper list of the form (key1 place1 ... keyN
placeN). Each placeK is either a symbol, which gets bound to the
value of keyK retrieved from the key-value store, or another
match form which gets destructured recursively.
SOURCE is a key-value store of type TYPE, which can be a plist,
an alist or a hash table.
TYPE is a token specifying the type of the key-value store.
Valid values are &plist, &alist and &hash.
(fn MATCH-FORM SOURCE TYPE)
2019-12-01 19:55:19 +01:00
(defalias 'dash--match-kv-1 #[771 "\300\301\302\303\304\305\306\307  \"\310\"\311\312%\313\314\"\"\"\207" [-flatten-n 1 -map make-byte-code 257 "\211@A@\302\301!\300\"9\203DC\202\303\"\207" vconcat vector [dash--get-expand-function dash--match] 7 "\n\n(fn KV)" -partition 2] 13 (#$ . 64295)])
2019-10-27 20:23:01 +01:00
#@96 Bind a symbol.
This works just like `let', there is no destructuring.
(fn MATCH-FORM SOURCE)
2019-12-01 19:55:19 +01:00
(defalias 'dash--match-symbol #[514 "DC\207" [] 4 (#$ . 65117)])
2019-10-27 20:23:01 +01:00
#@281 Match MATCH-FORM against SOURCE.
This function tests the MATCH-FORM and dispatches to specific
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.
(fn MATCH-FORM SOURCE)
2019-12-01 19:55:19 +01:00
(defalias 'dash--match #[514 "9\203\n\300\"\207:\203EA:\2030@9\2030A@\301=\2030@\211D\302AA\"B\207\303\304@!!\203@\305\306!\"\207\307\"\207\310!\205tG\311V\203p\312H9\203p\313H\301=\203p\312H\211D\302\314\311\"\"B\207\315\"\207" [dash--match-symbol &as dash--match functionp dash--get-expand-function dash--match-kv dash--match-kv-normalize-match-form dash--match-cons vectorp 2 0 1 dash--vector-tail dash--match-vector] 8 (#$ . 65286)])
2019-10-27 20:23:01 +01:00
#@364 Normalize VARLIST so that every binding is a list.
`let' allows specifying a binding which is not a list but simply
the place which is then automatically bound to nil, such that all
three of the following are identical and evaluate to nil.
(let (a) a)
(let ((a)) a)
(let ((a nil)) a)
This function normalizes all of these to the last form.
(fn VARLIST)
2019-12-01 19:55:19 +01:00
(defalias 'dash--normalize-let-varlist #[257 "\300\301\"\207" [mapcar #[257 "\211:\203\207\211\300D\207" [nil] 3 "\n\n(fn IT)"]] 4 (#$ . 66047)])
2019-10-27 20:23:01 +01:00
#@476 Bind variables according to VARLIST then eval BODY.
VARLIST is a list of lists of the form (PATTERN SOURCE). Each
PATTERN is matched against the SOURCE structurally. SOURCE is
only evaluated once for each PATTERN.
Each SOURCE can refer to the symbols already bound by this
VARLIST. This is useful if you want to destructure SOURCE
recursively but also want to name the intermediate structures.
See `-let' for the list of all possible patterns.
(fn VARLIST &rest BODY)
2019-12-01 19:55:19 +01:00
(defalias '-let* '(macro . #[385 "\300!\301\302\303\304\"\"\305BB\207" [dash--normalize-let-varlist apply append mapcar #[257 "\300@A@\"\207" [dash--match] 4 "\n\n(fn IT)"] let*] 8 (#$ . 66566)]))
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put -let* edebug-form-spec ((&rest [&or (sexp form) sexp]) body) function-put lisp-indent-function 1] 4)
#@5684 Bind variables according to VARLIST then eval BODY.
VARLIST is a list of lists of the form (PATTERN SOURCE). Each
PATTERN is matched against the SOURCE "structurally". SOURCE
is only evaluated once for each PATTERN. Each PATTERN is matched
recursively, and can therefore contain sub-patterns which are
matched against corresponding sub-expressions of SOURCE.
All the SOURCEs are evalled before any symbols are
bound (i.e. "in parallel").
If VARLIST only contains one (PATTERN SOURCE) element, you can
optionally specify it using a vector and discarding the
outer-most parens. Thus
(-let ((PATTERN SOURCE)) ..)
becomes
(-let [PATTERN SOURCE] ..).
`-let' uses a convention of not binding places (symbols) starting
with _ whenever it's possible. You can use this to skip over
entries you don't care about. However, this is not *always*
possible (as a result of implementation) and these symbols might
get bound to undefined values.
Following is the overview of supported patterns. Remember that
patterns can be matched recursively, so every a, b, aK in the
following can be a matching construct and not necessarily a
symbol/variable.
Symbol:
a - bind the SOURCE to A. This is just like regular `let'.
Conses and lists:
(a) - bind `car' of cons/list to A
(a . b) - bind car of cons to A and `cdr' to B
(a b) - bind car of list to A and `cadr' to B
(a1 a2 a3 ...) - bind 0th car of list to A1, 1st to A2, 2nd to A3 ...
(a1 a2 a3 ... aN . rest) - as above, but bind the Nth cdr to REST.
Vectors:
[a] - bind 0th element of a non-list sequence to A (works with
vectors, strings, bit arrays...)
[a1 a2 a3 ...] - bind 0th element of non-list sequence to A0, 1st to
A1, 2nd to A2, ...
If the PATTERN is shorter than SOURCE, the values at
places not in PATTERN are ignored.
If the PATTERN is longer than SOURCE, an `error' is
thrown.
[a1 a2 a3 ... &rest rest] - as above, but bind the rest of
the sequence to REST. This is
conceptually the same as improper list
matching (a1 a2 ... aN . rest)
Key/value stores:
(&plist key0 a0 ... keyN aN) - bind value mapped by keyK in the
SOURCE plist to aK. If the
value is not found, aK is nil.
Uses `plist-get' to fetch values.
(&alist key0 a0 ... keyN aN) - bind value mapped by keyK in the
SOURCE alist to aK. If the
value is not found, aK is nil.
Uses `assoc' to fetch values.
(&hash key0 a0 ... keyN aN) - bind value mapped by keyK in the
SOURCE hash table to aK. If the
value is not found, aK is nil.
Uses `gethash' to fetch values.
Further, special keyword &keys supports "inline" matching of
plist-like key-value pairs, similarly to &keys keyword of
`cl-defun'.
(a1 a2 ... aN &keys key1 b1 ... keyN bK)
This binds N values from the list to a1 ... aN, then interprets
the cdr as a plist (see key/value matching above).
A shorthand notation for kv-destructuring exists which allows the
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 "baz" is converted into `baz' pattern.
That is, the entire value under the key is bound to the derived
variable without any further destructuring.
This is possible only when the form following the key is not a
valid pattern (i.e. not a symbol, a cons cell or a vector).
Otherwise the matching proceeds as usual and in case of an
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)
;; we can specify some but not others
(&plist :foo 'bar explicit-bar) => (&plist :foo foo 'bar explicit-bar)
;; nothing happens, we store :foo in x
(&plist :foo x) => (&plist :foo x)
;; nothing happens, we match recursively
(&plist :foo (a b c)) => (&plist :foo (a b c))
You can name the source using the syntax SYMBOL &as PATTERN.
This syntax works with lists (proper or improper), vectors and
all types of maps.
(list &as a b c) (list 1 2 3)
binds A to 1, B to 2, C to 3 and LIST to (1 2 3).
Similarly:
(bounds &as beg . end) (cons 1 2)
binds BEG to 1, END to 2 and BOUNDS to (1 . 2).
(items &as first . rest) (list 1 2 3)
binds FIRST to 1, REST to (2 3) and ITEMS to (1 2 3)
[vect &as _ b c] [1 2 3]
binds B to 2, C to 3 and VECT to [1 2 3] (_ avoids binding as usual).
(plist &as &plist :b b) (list :a 1 :b 2 :c 3)
binds B to 2 and PLIST to (:a 1 :b 2 :c 3). Same for &alist and &hash.
This is especially useful when we want to capture the result of a
computation and destructure at the same time. Consider the
form (function-returning-complex-structure) returning a list of
two vectors with two items each. We want to capture this entire
result and pass it to another computation, but at the same time
we want to get the second item from each vector. We can achieve
it with pattern
(result &as [_ a] [_ b]) (function-returning-complex-structure)
Note: Clojure programmers may know this feature as the ":as
binding". The difference is that we put the &as at the front
because we need to support improper list binding.
(fn VARLIST &rest BODY)
2019-12-01 19:55:19 +01:00
(defalias '-let '(macro . #[385 "\300!\203\301\302\303H\304H\"BB\207\305!\306\303\2039@\307\310\311\"!A@DB\262\210\211T\262A\262\202\266\211\237\262\312\313\314\"\"\315\316BBE\207" [vectorp let* dash--match 0 1 dash--normalize-let-varlist nil make-symbol format "input%d" mapcar #[257 "\211@@A@D\207" [] 3 "\n\n(fn IT)"] -zip let -let*] 11 (#$ . 67418)]))
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put -let edebug-form-spec ([&or (&rest [&or (sexp form) sexp]) (vector [&rest [sexp form]])] body) function-put lisp-indent-function 1] 4)
#@423 Return a lambda which destructures its input as MATCH-FORM and executes BODY.
Note that you have to enclose the MATCH-FORM in a pair of parens,
such that:
(-lambda (x) body)
(-lambda (x y ...) body)
has the usual semantics of `lambda'. Furthermore, these get
translated into normal lambda, so there is no performance
penalty.
See `-let' for the description of destructuring mechanism.
(fn MATCH-FORM &rest BODY)
2019-12-01 19:55:19 +01:00
(defalias '-lambda '(macro . #[385 ":\204\n\300\301\302\"\207\303\304\"\203\305BB\207\306\307\2038@\211\310\311\312\"!DB\262\210\211T\262A\262\202\266\211\237\262\305\313\314\"\315BBE\207" [signal wrong-type-argument "match-form must be a list" -all\? symbolp lambda nil 0 make-symbol format "input%d" mapcar #[257 "\211A@\207" [] 2 "\n\n(fn IT)"] -let*] 11 (#$ . 73693)]))
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\305#\306\301\307\310#\207" [function-put -lambda doc-string-elt 2 lisp-indent-function defun put edebug-form-spec (&define sexp [&optional stringp] [&optional ("interactive" interactive)] def-body)] 6)
#@530 Bind each MATCH-FORM to the value of its VAL.
MATCH-FORM destructuring is done according to the rules of `-let'.
This macro allows you to bind multiple variables by destructuring
the value, so for example:
(-setq (a b) x
(&plist :c c) plist)
expands roughly speaking to the following code
(setq a (car x)
b (cadr x)
c (plist-get plist :c))
Care is taken to only evaluate each VAL once so that in case of
multiple assignments it does not cause unexpected side effects.
(fn [MATCH-FORM VAL]...)
2019-12-01 19:55:19 +01:00
(defalias '-setq '(macro . #[128 "\300G\301\"\302U\203\303\304!\210\305\306\307\301\"\"\310\311\"\312\305\313\"\314\315\302\"\316\317\305\320\"!BE\316\317!BF\207" [mod 2 1 error "Odd number of arguments" -map #[257 "\300@A@\"\207" [dash--match] 4 "\n\n(fn X)"] -partition -mapcat #[257 "\300\301\302\303\203&@\304\305\306@!\"\204\211B\262\210\211T\262A\262\202\266\211\237\262\"\207" [-map #[257 "\211@\211\300\301\302!\303Q!D\207" [make-symbol "--dash-binding-" symbol-name "--"] 7 "\n\n(fn BINDING)"] nil 0 string-prefix-p "--" symbol-name] 11 "\n\n(fn BINDINGS)"] let cadr let* -flatten-n setq -flatten reverse] 12 (#$ . 74764)]))
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put -setq edebug-form-spec (&rest sexp form) function-put lisp-indent-function 1] 4)
#@320 If all VALS evaluate to true, bind them to their corresponding
VARS and do THEN, otherwise do ELSE. VARS-VALS should be a list
of (VAR VAL) pairs.
Note: binding is done according to `-let*'. VALS are evaluated
sequentially, and evaluation stops after the first nil VAL is
encountered.
(fn VARS-VALS THEN &rest ELSE)
2019-12-01 19:55:19 +01:00
(defalias '-if-let* '(macro . #[642 "\300\301\302\303\304\"\"!\305\2036@\211@A@\306DC\307  BBBE\266\202\262\210\211T\262A\262\202\f\266\211\207" [reverse apply append mapcar #[257 "\300@A@\"\207" [dash--match] 4 "\n\n(fn IT)"] 0 let if] 15 (#$ . 76110)]))
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put -if-let* edebug-form-spec ((&rest (sexp form)) form body) function-put lisp-indent-function 2] 4)
#@153 If VAL evaluates to non-nil, bind it to VAR and do THEN,
otherwise do ELSE.
Note: binding is done according to `-let'.
(fn (VAR VAL) THEN &rest ELSE)
2019-12-01 19:55:19 +01:00
(defalias '-if-let '(macro . #[642 "\300CBBB\207" [-if-let*] 7 (#$ . 76875)]))
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put -if-let edebug-form-spec ((sexp form) form body) function-put lisp-indent-function 2] 4)
#@111 If VAL evaluates to non-nil, bind it to symbol `it' and do THEN,
otherwise do ELSE.
(fn VAL THEN &rest ELSE)
2019-12-01 19:55:19 +01:00
(defalias '--if-let '(macro . #[642 "\300\301DBBB\207" [-if-let it] 7 (#$ . 77270)]))
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put --if-let edebug-form-spec (form form body) function-put lisp-indent-function 2] 4)
#@301 If all VALS evaluate to true, bind them to their corresponding
VARS and execute body. VARS-VALS should be a list of (VAR VAL)
pairs.
Note: binding is done according to `-let*'. VALS are evaluated
sequentially, and evaluation stops after the first nil VAL is
encountered.
(fn VARS-VALS &rest BODY)
2019-12-01 19:55:19 +01:00
(defalias '-when-let* '(macro . #[385 "\300\301BE\207" [-if-let* progn] 6 (#$ . 77624)]))
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put -when-let* edebug-form-spec ((&rest (sexp form)) body) function-put lisp-indent-function 1] 4)
#@134 If VAL evaluates to non-nil, bind it to VAR and execute body.
Note: binding is done according to `-let'.
(fn (VAR VAL) &rest BODY)
2019-12-01 19:55:19 +01:00
(defalias '-when-let '(macro . #[385 "\300\301BE\207" [-if-let progn] 6 (#$ . 78183)]))
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put -when-let edebug-form-spec ((sexp form) body) function-put lisp-indent-function 1] 4)
#@92 If VAL evaluates to non-nil, bind it to symbol `it' and
execute body.
(fn VAL &rest BODY)
2019-12-01 19:55:19 +01:00
(defalias '--when-let '(macro . #[385 "\300\301BE\207" [--if-let progn] 6 (#$ . 78563)]))
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put --when-let edebug-form-spec (form body) function-put lisp-indent-function 1] 4)
#@191 Tests for equality use this function or `equal' if this is nil.
It should only be set using dynamic scope with a let, like:
(let ((-compare-fn #\='=)) (-union numbers1 numbers2 numbers3)
2019-12-01 19:55:19 +01:00
(defvar -compare-fn nil (#$ . 78898))
2019-10-27 20:23:01 +01:00
#@160 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.
Alias: `-uniq'
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-distinct #[257 "\211G\211\301V\205\302>\205\303\304\206\305\306$\211\203P\307\310\203G@\311\"\204;\312\313#\203;\211B\262\210\211T\262A\262\202\266\211\237\262\202t\310\203p@\314\"\204d\211B\262\210\211T\262A\262\202R\266\211\237\207" [-compare-fn 32 (nil equal eq eql) make-hash-table :test equal :size nil 0 gethash puthash t -contains\?] 11 (#$ . 79133)])
2019-10-27 20:23:01 +01:00
(defalias '-uniq '-distinct)
#@197 Return a new list containing the elements of LIST and elements of LIST2 that are not in LIST.
The test for equality is done with `equal',
or with `-compare-fn' if that's non-nil.
(fn LIST LIST2)
2019-12-01 19:55:19 +01:00
(defalias '-union #[514 "\301!\302\300!\203\203\202\303\211\304>\203_\305\306\"\307\2038@\310\311#\266\211T\262A\262\202\266\307\203Z@\312\"\204N\211B\262\210\211T\262A\262\202<\266\202\201\307\203@\313\"\204s\211B\262\210\211T\262A\262\202a\266\211\237)\207" [-compare-fn reverse boundp equal (eq eql equal) make-hash-table :test 0 puthash t gethash -contains\?] 12 (#$ . 79745)])
2019-10-27 20:23:01 +01:00
#@191 Return a new list containing only the elements that are members of both LIST and LIST2.
The test for equality is done with `equal',
or with `-compare-fn' if that's non-nil.
(fn LIST LIST2)
2019-12-01 19:55:19 +01:00
(defalias '-intersection #[514 "\300\301\203!@\302\"\203\211B\262\210\211T\262A\262\202\266\211\237\207" [nil 0 -contains\?] 9 (#$ . 80386)])
2019-10-27 20:23:01 +01:00
#@174 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.
(fn LIST LIST2)
2019-12-01 19:55:19 +01:00
(defalias '-difference #[514 "\300\301\203!@\302\"\204\211B\262\210\211T\262A\262\202\266\211\237\207" [nil 0 -contains\?] 9 (#$ . 80741)])
2019-10-27 20:23:01 +01:00
#@42 Return the power set of LIST.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-powerset #[257 "\211\204\300\207\301A!\302\303\304\305\306\307\310!\311\"\312\313%\"\"\207" [(nil) -powerset append mapcar make-byte-code 257 "\300@B\207" vconcat vector [] 3 "\n\n(fn X)"] 10 (#$ . 81076)])
2019-10-27 20:23:01 +01:00
#@45 Return the permutations of LIST.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-permutations #[257 "\211\204\300\207\301\302\303\304\305\306\307\310!\311\"\312\313%\"\"\207" [(nil) apply append mapcar make-byte-code 257 "\301\302\303\304\305\306!\307\"\310\311%\312\313\300\"!\"\207" vconcat vector [mapcar make-byte-code 257 "\300B\207" vconcat vector [] 3 "\n\n(fn PERM)" -permutations remove] 8 "\n\n(fn X)"] 10 (#$ . 81350)])
2019-10-27 20:23:01 +01:00
#@41 Return all prefixes of LIST.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-inits #[257 "\211C\300!\262\203\300A\211\262!B\262\202\211\207" [reverse] 5 (#$ . 81771)])
2019-10-27 20:23:01 +01:00
#@40 Return all suffixes of LIST
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-tails #[257 "\300\301\302#\207" [-reductions-r-from cons nil] 5 (#$ . 81931)])
2019-10-27 20:23:01 +01:00
#@62 Return the longest common prefix of LISTS.
(fn &rest LISTS)
2019-12-01 19:55:19 +01:00
(defalias '-common-prefix #[128 "\211\211\203b\211@A\300\203Z@\301\302\300\203F\203F@\203/\211A\262\n\242\232\2045\301\262\202:\211B\262\210\211T\262A\262\202\266\211\237\262\262\210\211T\262A\262\202\n\266\211\262\202\242\301\211\211\302\300\203\232\203\232@\203\203\211A\262\242\232\204\211\301\262\202\216\211B\262\210\211T\262A\262\202h\266\211\237\262\266\202\207" [0 nil t] 13 (#$ . 82068)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -common-prefix pure t side-effect-free] 5)
#@62 Return the longest common suffix of LISTS.
(fn &rest LISTS)
2019-12-01 19:55:19 +01:00
(defalias '-common-suffix #[128 "\300\301\302\303\"\"\237\207" [apply -common-prefix mapcar reverse] 6 (#$ . 82707)])
2019-10-27 20:23:01 +01:00
#@169 Return non-nil if LIST contains ELEMENT.
The test for equality is done with `equal', or with `-compare-fn'
if that's non-nil.
Alias: `-contains-p'
(fn LIST ELEMENT)
2019-12-01 19:55:19 +01:00
(defalias '-contains\? #[514 "\204\n\211\235\202:\301=\203\211>\202:\302=\203#\303\"\202:\211\2037@\"\2047\211A\262\202$\211\262??\207" [-compare-fn eq eql memql] 6 (#$ . 82894)])
2019-10-27 20:23:01 +01:00
(defalias '-contains-p '-contains\?)
#@149 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'
(fn LIST LIST2)
2019-12-01 19:55:19 +01:00
(defalias '-same-items\? #[514 "GGU\205\300\"GU\207" [-intersection] 8 (#$ . 83309)])
2019-10-27 20:23:01 +01:00
(defalias '-same-items-p '-same-items\?)
#@86 Return non-nil if PREFIX is prefix of LIST.
Alias: `-is-prefix-p'
(fn PREFIX LIST)
2019-12-01 19:55:19 +01:00
(defalias '-is-prefix\? #[514 "\211\300\301\203*\203*@@\232\204\302\262\202A\262\210\211T\262A\262\202\266?\207" [t 0 nil] 8 (#$ . 83599)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -is-prefix\? pure t side-effect-free] 5)
#@86 Return non-nil if SUFFIX is suffix of LIST.
Alias: `-is-suffix-p'
(fn SUFFIX LIST)
2019-12-01 19:55:19 +01:00
(defalias '-is-suffix\? #[514 "\300\301!\301!\"\207" [-is-prefix\? reverse] 6 (#$ . 83962)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -is-suffix\? pure t side-effect-free] 5)
#@118 Return non-nil if INFIX is infix of LIST.
This operation runs in O(n^2) time
Alias: `-is-infix-p'
(fn INFIX LIST)
2019-12-01 19:55:19 +01:00
(defalias '-is-infix\? #[514 "\300\211\204\203\301\"\262A\262\202\211\207" [nil -is-prefix\?] 6 (#$ . 84260)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\305\306\307\"\210\305\310\311\"\210\305\312\301\"\207" [function-put -is-infix\? pure t side-effect-free defalias -is-prefix-p -is-prefix\? -is-suffix-p -is-suffix\? -is-infix-p] 5)
#@268 Sort LIST, stably, comparing elements using COMPARATOR.
Return the sorted list. LIST is NOT modified by side effects.
COMPARATOR is called with two elements of LIST, and should return non-nil
if the first element should sort before the second.
(fn COMPARATOR LIST)
2019-12-01 19:55:19 +01:00
(defalias '-sort #[514 "\300\301!\"\207" [sort copy-sequence] 5 (#$ . 84736)])
2019-10-27 20:23:01 +01:00
#@44 Anaphoric form of `-sort'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--sort '(macro . #[514 "\300\301\302EE\207" [-sort lambda (it other)] 6 (#$ . 85090)]))
2019-10-27 20:23:01 +01:00
(put '--sort 'edebug-form-spec '(form form))
#@151 Return a list with ARGS.
If first item of ARGS is already a list, simply return ARGS. If
not, return a list with ARGS as elements.
(fn &rest ARGS)
2019-12-01 19:55:19 +01:00
(defalias '-list #[128 "\211@\211<\203 \211\202\f\207" [] 3 (#$ . 85286)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -list pure t side-effect-free] 5)
#@82 Return a list with X repeated N times.
Return nil if N is less than 1.
(fn N X)
2019-12-01 19:55:19 +01:00
(defalias '-repeat #[514 "\300\301\211W\203B\262\211T\262\202\266\211\207" [nil 0] 7 (#$ . 85624)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -repeat pure t side-effect-free] 5)
#@36 Return the sum of LIST.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-sum #[257 "\300\301\"\207" [apply +] 4 (#$ . 85928)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -sum pure t side-effect-free] 5)
#@87 Return a list with running sums of items in LIST.
LIST must be non-empty.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-running-sum #[257 "\211:\204 \300\301!\210\302\303\"\207" [error "LIST must be non-empty" -reductions +] 4 (#$ . 86139)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -running-sum pure t side-effect-free] 5)
#@40 Return the product of LIST.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-product #[257 "\300\301\"\207" [apply *] 4 (#$ . 86478)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -product pure t side-effect-free] 5)
#@91 Return a list with running products of items in LIST.
LIST must be non-empty.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-running-product #[257 "\211:\204 \300\301!\210\302\303\"\207" [error "LIST must be non-empty" -reductions *] 4 (#$ . 86701)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -running-product pure t side-effect-free] 5)
#@70 Return the largest value from LIST of numbers or markers.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-max #[257 "\300\301\"\207" [apply max] 4 (#$ . 87052)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -max pure t side-effect-free] 5)
#@71 Return the smallest value from LIST of numbers or markers.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-min #[257 "\300\301\"\207" [apply min] 4 (#$ . 87299)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -min pure t side-effect-free] 5)
#@225 Take a comparison function COMPARATOR and a LIST and return
the greatest element of the list by the comparison function.
See also combinator `-on' which can transform the values before
comparing them.
(fn COMPARATOR LIST)
2019-12-01 19:55:19 +01:00
(defalias '-max-by #[514 "\211\211\2033\211@A\300\203+@\"\203\211\202\262\210\211T\262A\262\202\n\266\211\262\202C\301\211\"\203@\211\202A\266\202\207" [0 nil] 10 (#$ . 87548)])
2019-10-27 20:23:01 +01:00
#@222 Take a comparison function COMPARATOR and a LIST and return
the least element of the list by the comparison function.
See also combinator `-on' which can transform the values before
comparing them.
(fn COMPARATOR LIST)
2019-12-01 19:55:19 +01:00
(defalias '-min-by #[514 "\211\211\2033\211@A\300\203+@\"\203\202\211\262\210\211T\262A\262\202\n\266\211\262\202C\301\211\"\203@\202A\211\266\202\207" [0 nil] 10 (#$ . 87985)])
2019-10-27 20:23:01 +01:00
#@117 Anaphoric version of `-max-by'.
The items for the comparator form are exposed as "it" and "other".
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--max-by '(macro . #[514 "\300\301\302EE\207" [-max-by lambda (it other)] 6 (#$ . 88419)]))
2019-10-27 20:23:01 +01:00
(put '--max-by 'edebug-form-spec '(form form))
#@117 Anaphoric version of `-min-by'.
The items for the comparator form are exposed as "it" and "other".
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--min-by '(macro . #[514 "\300\301\302EE\207" [-min-by lambda (it other)] 6 (#$ . 88694)]))
2019-10-27 20:23:01 +01:00
(put '--min-by 'edebug-form-spec '(form form))
#@182 Return a list of iterated applications of FUN to INIT.
This means a list of form:
(init (fun init) (fun (fun init)) ...)
N is the length of the returned list.
(fn FUN INIT N)
2019-12-01 19:55:19 +01:00
(defalias '-iterate #[771 "\211\300U?\205'CS\300\211W\203!@!B\262\211T\262\202\f\266\211\237\262\207" [0] 8 (#$ . 88969)])
2019-10-27 20:23:01 +01:00
#@139 Compute the (least) fixpoint of FN with initial input LIST.
FN is called at least once, results are compared with `equal'.
(fn FN LIST)
2019-12-01 19:55:19 +01:00
(defalias '-fix #[514 "!\232\204\211\262!\262\202\211\207" [] 5 (#$ . 89293)])
2019-10-27 20:23:01 +01:00
#@43 Anaphoric form of `-fix'.
(fn FORM LIST)
2019-12-01 19:55:19 +01:00
(defalias '--fix '(macro . #[514 "\300\301\302EE\207" [-fix lambda (it)] 6 (#$ . 89528)]))
2019-10-27 20:23:01 +01:00
#@362 Build a list from SEED using FUN.
This is "dual" operation to `-reduce-r': while -reduce-r
consumes a list to produce a single value, `-unfold' takes a
seed value and builds a (potentially infinite!) list.
FUN should return `nil' to stop the generating process, or a
cons (A . B), where A will be prepended to the result and B is
the new seed.
(fn FUN SEED)
2019-12-01 19:55:19 +01:00
(defalias '-unfold #[514 "!\300\203@B\262A!\262\202\211\237\207" [nil] 6 (#$ . 89670)])
2019-10-27 20:23:01 +01:00
#@49 Anaphoric version of `-unfold'.
(fn FORM SEED)
2019-12-01 19:55:19 +01:00
(defalias '--unfold '(macro . #[514 "\300\301\302EE\207" [-unfold lambda (it)] 6 (#$ . 90138)]))
2019-10-27 20:23:01 +01:00
(put '--unfold 'edebug-form-spec '(form form))
#@114 Return non-nil if CON is true cons pair.
That is (A . B) where B is not a list.
Alias: `-cons-pair-p'
(fn CON)
2019-12-01 19:55:19 +01:00
(defalias '-cons-pair\? #[257 "\211<\205 \211A<?\207" [] 2 (#$ . 90339)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\305\306\301\"\207" [function-put -cons-pair\? pure t side-effect-free defalias -cons-pair-p] 5)
#@88 Convert a cons pair to a list with `car' and `cdr' of the pair respectively.
(fn CON)
2019-12-01 19:55:19 +01:00
(defalias '-cons-to-list #[257 "\211@AD\207" [] 3 (#$ . 90676)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -cons-to-list pure t side-effect-free] 5)
#@192 Convert a value to a list.
If the value is a cons pair, make a list with two elements, `car'
and `cdr' of the pair respectively.
If the value is anything else, wrap it in a list.
(fn VAL)
2019-12-01 19:55:19 +01:00
(defalias '-value-to-list #[257 "\300!\203\n\301!\207\211C\207" [-cons-pair\? -cons-to-list] 3 (#$ . 90948)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -value-to-list pure t side-effect-free] 5)
#@423 Apply FN to each element of TREE, and make a list of the results.
If elements of TREE are lists themselves, apply FN recursively to
elements of these nested lists.
Then reduce the resulting lists using FOLDER and initial value
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.
(fn FN FOLDER INIT-VALUE TREE)
2019-12-01 19:55:19 +01:00
(defalias '-tree-mapreduce-from #[1028 "\211\204\300\207\301!\203!\207\211<\203.\302\303\304\305\306\307\310\f\f\f#\311\"\312\313%\"#\207!\207" [nil -cons-pair\? -reduce-r-from mapcar make-byte-code 257 "\303\300\301\302$\207" vconcat vector [-tree-mapreduce-from] 6 "\n\n(fn X)"] 16 (#$ . 91372)])
2019-10-27 20:23:01 +01:00
#@77 Anaphoric form of `-tree-mapreduce-from'.
(fn FORM FOLDER INIT-VALUE TREE)
2019-12-01 19:55:19 +01:00
(defalias '--tree-mapreduce-from '(macro . #[1028 "\300\301\302E\301\303E\257\207" [-tree-mapreduce-from lambda (it) (it acc)] 9 (#$ . 92116)]))
2019-10-27 20:23:01 +01:00
(put '--tree-mapreduce-from 'edebug-form-spec '(form form form form))
#@407 Apply FN to each element of TREE, and make a list of the results.
If elements of TREE are lists themselves, apply FN recursively to
elements of these nested lists.
Then reduce the resulting lists using FOLDER and initial value
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.
(fn FN FOLDER TREE)
2019-12-01 19:55:19 +01:00
(defalias '-tree-mapreduce #[771 "\211\204\300\207\301!\203!\207\211<\203+\302\303\304\305\306\307\310\n\n\"\311\"\312\313%\"\"\207!\207" [nil -cons-pair\? -reduce-r mapcar make-byte-code 257 "\302\300\301#\207" vconcat vector [-tree-mapreduce] 5 "\n\n(fn X)"] 13 (#$ . 92421)])
2019-10-27 20:23:01 +01:00
#@61 Anaphoric form of `-tree-mapreduce'.
(fn FORM FOLDER TREE)
2019-12-01 19:55:19 +01:00
(defalias '--tree-mapreduce '(macro . #[771 "\300\301\302E\301\303EF\207" [-tree-mapreduce lambda (it) (it acc)] 8 (#$ . 93127)]))
2019-10-27 20:23:01 +01:00
(put '--tree-mapreduce 'edebug-form-spec '(form form form))
#@85 Apply FN to each element of TREE while preserving the tree structure.
(fn FN TREE)
2019-12-01 19:55:19 +01:00
(defalias '-tree-map #[514 "\211\204\300\207\301!\203!\207\211<\203&\302\303\304\305\306\307!\310\"\311\312%\"\207!\207" [nil -cons-pair\? mapcar make-byte-code 257 "\301\300\"\207" vconcat vector [-tree-map] 4 "\n\n(fn X)"] 9 (#$ . 93387)])
2019-10-27 20:23:01 +01:00
#@48 Anaphoric form of `-tree-map'.
(fn FORM TREE)
2019-12-01 19:55:19 +01:00
(defalias '--tree-map '(macro . #[514 "\300\301\302EE\207" [-tree-map lambda (it)] 6 (#$ . 93733)]))
2019-10-27 20:23:01 +01:00
(put '--tree-map 'edebug-form-spec '(form form))
#@346 Use FN to reduce elements of list TREE.
If elements of TREE are lists themselves, apply the reduction recursively.
FN is first applied to INIT-VALUE and first element of the list,
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.
(fn FN INIT-VALUE TREE)
2019-12-01 19:55:19 +01:00
(defalias '-tree-reduce-from #[771 "\211\204\300\207\301!\203 \207\211<\203)\302\303\304\305\306\307\310  \"\311\"\312\313%\"#\207\207" [nil -cons-pair\? -reduce-r-from mapcar make-byte-code 257 "\302\300\301#\207" vconcat vector [-tree-reduce-from] 5 "\n\n(fn X)"] 14 (#$ . 93939)])
2019-10-27 20:23:01 +01:00
#@67 Anaphoric form of `-tree-reduce-from'.
(fn FORM INIT-VALUE TREE)
2019-12-01 19:55:19 +01:00
(defalias '--tree-reduce-from '(macro . #[771 "\300\301\302EF\207" [-tree-reduce-from lambda (it acc)] 7 (#$ . 94585)]))
2019-10-27 20:23:01 +01:00
(put '--tree-reduce-from 'edebug-form-spec '(form form form))
#@332 Use FN to reduce elements of list TREE.
If elements of TREE are lists themselves, apply the reduction recursively.
FN is first applied to first element of the list and second
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.
(fn FN TREE)
2019-12-01 19:55:19 +01:00
(defalias '-tree-reduce #[514 "\211\204\300\207\301!\203 \207\211<\203&\302\303\304\305\306\307\310 !\311\"\312\313%\"\"\207\207" [nil -cons-pair\? -reduce-r mapcar make-byte-code 257 "\301\300\"\207" vconcat vector [-tree-reduce] 4 "\n\n(fn X)"] 11 (#$ . 94844)])
2019-10-27 20:23:01 +01:00
#@51 Anaphoric form of `-tree-reduce'.
(fn FORM TREE)
2019-12-01 19:55:19 +01:00
(defalias '--tree-reduce '(macro . #[514 "\300\301\302EE\207" [-tree-reduce lambda (it acc)] 6 (#$ . 95455)]))
2019-10-27 20:23:01 +01:00
(put '--tree-reduce 'edebug-form-spec '(form form))
#@207 Call FUN on each node of TREE that satisfies PRED.
If PRED returns nil, continue descending down this node. If PRED
returns non-nil, apply FUN to this node and do not descend
further.
(fn PRED FUN TREE)
2019-12-01 19:55:19 +01:00
(defalias '-tree-map-nodes #[771 "!\203\n!\207\211<\203(\300!\204(\301\302\303\304\305\306\"\307\"\310\311%\"\207\207" [-cons-pair\? -map make-byte-code 257 "\302\300\301#\207" vconcat vector [-tree-map-nodes] 5 "\n\n(fn X)"] 11 (#$ . 95677)])
2019-10-27 20:23:01 +01:00
#@59 Anaphoric form of `-tree-map-nodes'.
(fn PRED FORM TREE)
2019-12-01 19:55:19 +01:00
(defalias '--tree-map-nodes '(macro . #[771 "\300\301\302E\301\303EF\207" [-tree-map-nodes lambda (it) (it)] 8 (#$ . 96147)]))
2019-10-27 20:23:01 +01:00
#@363 Return a sequence of the nodes in TREE, in depth-first search order.
BRANCH is a predicate of one argument that returns non-nil if the
passed argument is a branch, that is, a node that can have children.
CHILDREN is a function of one argument that returns the children
of the passed branch node.
Non-branch nodes are simply copied.
(fn BRANCH CHILDREN TREE)
2019-12-01 19:55:19 +01:00
(defalias '-tree-seq #[771 "\211!\205\300\301\302\303\304\305  \"\306\"\307\310%!\"B\207" [-mapcat make-byte-code 257 "\302\300\301#\207" vconcat vector [-tree-seq] 5 "\n\n(fn X)"] 12 (#$ . 96342)])
2019-10-27 20:23:01 +01:00
#@59 Anaphoric form of `-tree-seq'.
(fn BRANCH CHILDREN TREE)
2019-12-01 19:55:19 +01:00
(defalias '--tree-seq '(macro . #[771 "\300\301\302E\301\303EF\207" [-tree-seq lambda (it) (it)] 8 (#$ . 96918)]))
2019-10-27 20:23:01 +01:00
#@205 Create a deep copy of LIST.
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.
(fn LIST)
2019-12-01 19:55:19 +01:00
(defalias '-clone #[257 "\300\301\"\207" [-tree-map identity] 4 (#$ . 97101)])
2019-10-27 20:23:01 +01:00
(byte-code "\300\301\302\303#\300\301\304\303#\300\207" [function-put -clone pure t side-effect-free] 5)
#@69 Add syntax highlighting to dash functions, macros and magic values.
2019-12-01 19:55:19 +01:00
(defalias 'dash-enable-font-lock #[0 "\300\301\302\"\207" [eval-after-load lisp-mode #[0 "\302\303\304\305\306\307\310\"\311Q\312BC\313#\210\304\305\314\307\310\"\311Q\315BC\313#\266\316 \317\205N@r\211q\210\305=\203A\320\301!\203A \203A\321 \210)\210\211T\262A\262\202$\207" [major-mode font-lock-mode ("!cons" "!cdr" "-each" "--each" "-each-indexed" "--each-indexed" "-each-while" "--each-while" "-doto" "-dotimes" "--dotimes" "-map" "--map" "-reduce-from" "--reduce-from" "-reduce" "--reduce" "-reduce-r-from" "--reduce-r-from" "-reduce-r" "--reduce-r" "-reductions-from" "-reductions-r-from" "-reductions" "-reductions-r" "-filter" "--filter" "-select" "--select" "-remove" "--remove" "-reject" "--reject" "-remove-first" "--remove-first" "-reject-first" "--reject-first" "-remove-last" "--remove-last" "-reject-last" "--reject-last" "-remove-item" "-non-nil" "-keep" "--keep" "-map-indexed" "--map-indexed" "-splice" "--splice" "-splice-list" "--splice-list" "-map-when" "--map-when" "-replace-where" "--replace-where" "-map-first" "--map-first" "-map-last" "--map-last" "-replace" "-replace-first" "-replace-last" "-flatten" "-flatten-n" "-concat" "-mapcat" "--mapcat" "-copy" "-cons*" "-snoc" "-first" "--first" "-find" "--find" "-some" "--some" "-any" "--any" "-last" "--last" "-first-item" "-second-item" "-third-item" "-fourth-item" "-fifth-item" "-last-item" "-butlast" "-count" "--count" "-any?" "--any?" "-some?" "--some?" "-any-p" "--any-p" "-some-p" "--some-p" "-some->" "-some->>" "-some-->" "-all?" "-all-p" "--all?" "--all-p" "-every?" "--every?" "-all-p" "--all-p" "-every-p" "--every-p" "-none?" "--none?" "-none-p" "--none-p" "-only-some?" "--only-some?" "-only-some-p" "--only-some-p" "-slice" "-take" "-drop" "-drop-last" "-take-last" "-take-while" "--take-while" "-drop-while" "--drop-while" "-split-at" "-rotate" "-insert-at" "-replace-at" "-update-at" "--update-at" "-remove-at" "-remove-at-indices" "-split-with" "--split-with" "-split-on" "-split-when" "--split-when" "-separate" "--separate" "-partition-all-in-steps" "-partition-in-steps" "-partition-all" "-partition" "-partition-after-item" "-partition-after-pred" "-partition-before-item" "-partition-before-pred" "-partition-by" "--partition-by" "-partition-by-header" "--partition-by-header" "-group-by" "--group-by" "-interpose" "-interleave" "-unzip" "-zip-with" "--zip-with" "-zip" "-zip-fill" "-zip-pair" "-cycle" "-pad" "-annotate" "--annotate" "-table" "-table-flat" "-partial" "-elem-index" "-elem-indices" "-find-indices" "--find-indices" "-find-index" "--find-index" "-find-last-index" "--find-last-index" "-select-by-indices" "-select-columns" "-select-column" "-grade-up" "-grade-down" "->" "->>" "-->" "-as->" "-when-let" "-when-let*" "--when-let" "-if-let" "-if-let*" "--if-let" "-let*" "-let" "-lambda" "-distinct" "-uniq" "-union" "-intersection" "-difference" "-powerset" "-permutations" "-inits" "-tails" "-common-prefix" "-common-suffix" "-contains?" "-contains-p" "-same-items?" "-same-items-p" "-is-prefix-p" "-is-prefix?" "-is-suffix-p" "-is-suffix?" "-is-infix-p" "-is-infix?" "-sort" "--sort" "-list" "-repeat" "-sum" "-running-sum" "-product" "-running-product" "-max" "-min" "-max-by" "--max-by" "-min-by" "--min-by" "-iterate" "--iterate" "-fix" "--fix" "-unfold" "--unfold" "-cons-pair?" "-cons-pair-p" "-cons-to-list" "-value-to-list" "-tree-mapreduce-from" "--tree-mapreduce-from" "-tree-mapreduce" "--tree-mapreduce" "-tree-map" "--tree-map" "-tree-reduce-from" "--tree-reduce-from" "-tree-reduce" "--tree-reduce" "-tree-seq" "--tree-seq" "-tree-map-nodes" "--tree-map-nodes" "-clone" "-rpartial" "-juxt" "-applify" "-on" "-flip" "-const" "-cut" "-orfn" "-andfn" "-iteratefn" "-fixfn" "-prodfn") ("it" "it-index" "acc" "other") font-lock-add-keywords emacs-lisp-mode "\\_<" regexp-opt paren "\\_>" (1 font-lock-variable-name-face) append "(\\s-*" (1 font-lock-keyword-face) buffer-list 0 boundp font-lock-refresh-defaults] 8]] 3 (#$ . 97496)])
2019-10-27 20:23:01 +01:00
(provide 'dash)