Restore some newlines in docstrings

* dash.el (-each, -each-indexed, -each-while, -each-r)
(-each-r-while, -dotimes, -map, -reduce-from, -reduce)
(-reduce-r-from, -reduce-r, -reductions-from, -reductions)
(-reductions-r-from, -reductions-r, -filter, -remove, -remove-first)
(-remove-last, -keep, -map-indexed, -first, -some, -take-while)
(-drop-while, -drop, -cons-pair?): Restore some sectioning newlines
in docstrings for the benefit of README.md.
(--map): Remove unnecessary newline.

* README.md:
* dash.texi: Regenerate docs.
master
Basil L. Contovounesios 5 years ago
parent 3fa27c484c
commit 7048e6881f
No known key found for this signature in database
GPG Key ID: 205AB54A5D5D8CFF
  1. 49
      README.md
  2. 50
      dash.el
  3. 49
      dash.texi

@ -368,6 +368,7 @@ new list.
#### -map `(fn list)` #### -map `(fn list)`
Apply `fn` to each item in `list` and return the list of results. Apply `fn` to each item in `list` and return the list of results.
This function's anaphoric counterpart is `--map`. This function's anaphoric counterpart is `--map`.
```el ```el
@ -423,6 +424,7 @@ This is like [`-map`](#-map-fn-list), but `fn` takes two arguments: the index of
current element within `list`, and the element itself. current element within `list`, and the element itself.
This function's anaphoric counterpart is `--map-indexed`. This function's anaphoric counterpart is `--map-indexed`.
For a side-effecting variant, see also [`-each-indexed`](#-each-indexed-list-fn). For a side-effecting variant, see also [`-each-indexed`](#-each-indexed-list-fn).
```el ```el
@ -499,8 +501,11 @@ Functions returning a sublist of the original list.
#### -filter `(pred list)` #### -filter `(pred list)`
Return a new list of the items in `list` for which `pred` returns non-nil. Return a new list of the items in `list` for which `pred` returns non-nil.
Alias: `-select`. Alias: `-select`.
This function's anaphoric counterpart is `--filter`. This function's anaphoric counterpart is `--filter`.
For similar operations, see also [`-keep`](#-keep-fn-list) and [`-remove`](#-remove-pred-list). For similar operations, see also [`-keep`](#-keep-fn-list) and [`-remove`](#-remove-pred-list).
```el ```el
@ -512,8 +517,11 @@ For similar operations, see also [`-keep`](#-keep-fn-list) and [`-remove`](#-rem
#### -remove `(pred list)` #### -remove `(pred list)`
Return a new list of the items in `list` for which `pred` returns nil. Return a new list of the items in `list` for which `pred` returns nil.
Alias: `-reject`. Alias: `-reject`.
This function's anaphoric counterpart is `--remove`. This function's anaphoric counterpart is `--remove`.
For similar operations, see also [`-keep`](#-keep-fn-list) and [`-filter`](#-filter-pred-list). For similar operations, see also [`-keep`](#-keep-fn-list) and [`-filter`](#-filter-pred-list).
```el ```el
@ -529,8 +537,11 @@ This is a non-destructive operation, but only the front of `list`
leading up to the removed item is a copy; the rest is `list`'s leading up to the removed item is a copy; the rest is `list`'s
original tail. If no item is removed, then the result is a original tail. If no item is removed, then the result is a
complete copy. complete copy.
Alias: `-reject-first`. Alias: `-reject-first`.
This function's anaphoric counterpart is `--remove-first`. This function's anaphoric counterpart is `--remove-first`.
See also [`-map-first`](#-map-first-pred-rep-list), [`-remove-item`](#-remove-item-item-list), and [`-remove-last`](#-remove-last-pred-list). See also [`-map-first`](#-map-first-pred-rep-list), [`-remove-item`](#-remove-item-item-list), and [`-remove-last`](#-remove-last-pred-list).
```el ```el
@ -544,8 +555,11 @@ See also [`-map-first`](#-map-first-pred-rep-list), [`-remove-item`](#-remove-it
Remove the last item from `list` for which `pred` returns non-nil. Remove the last item from `list` for which `pred` returns non-nil.
The result is a copy of `list` regardless of whether an element is The result is a copy of `list` regardless of whether an element is
removed. removed.
Alias: `-reject-last`. Alias: `-reject-last`.
This function's anaphoric counterpart is `--remove-last`. This function's anaphoric counterpart is `--remove-last`.
See also [`-map-last`](#-map-last-pred-rep-list), [`-remove-item`](#-remove-item-item-list), and [`-remove-first`](#-remove-first-pred-list). See also [`-map-last`](#-map-last-pred-rep-list), [`-remove-item`](#-remove-item-item-list), and [`-remove-first`](#-remove-first-pred-list).
```el ```el
@ -624,6 +638,7 @@ See also: [`-take`](#-take-n-list).
Return the tail (not a copy) of `list` without the first `n` items. Return the tail (not a copy) of `list` without the first `n` items.
Return nil if `list` contains `n` items or fewer. Return nil if `list` contains `n` items or fewer.
Return `list` if `n` is zero or less. Return `list` if `n` is zero or less.
For another variant, see also [`-drop-last`](#-drop-last-n-list). For another variant, see also [`-drop-last`](#-drop-last-n-list).
```el ```el
@ -652,7 +667,9 @@ Take successive items from `list` for which `pred` returns non-nil.
`pred` is a function of one argument. Return a new list of the `pred` is a function of one argument. Return a new list of the
successive elements from the start of `list` for which `pred` returns successive elements from the start of `list` for which `pred` returns
non-nil. non-nil.
This function's anaphoric counterpart is `--take-while`. This function's anaphoric counterpart is `--take-while`.
For another variant, see also [`-drop-while`](#-drop-while-pred-list). For another variant, see also [`-drop-while`](#-drop-while-pred-list).
```el ```el
@ -667,7 +684,9 @@ Drop successive items from `list` for which `pred` returns non-nil.
`pred` is a function of one argument. Return the tail (not a copy) `pred` is a function of one argument. Return the tail (not a copy)
of `list` starting from its first element for which `pred` returns of `list` starting from its first element for which `pred` returns
nil. nil.
This function's anaphoric counterpart is `--drop-while`. This function's anaphoric counterpart is `--drop-while`.
For another variant, see also [`-take-while`](#-take-while-pred-list). For another variant, see also [`-take-while`](#-take-while-pred-list).
```el ```el
@ -729,6 +748,7 @@ Functions returning a modified copy of the input list.
Return a new list of the non-nil results of applying `fn` to each item in `list`. Return a new list of the non-nil results of applying `fn` to each item in `list`.
Like [`-filter`](#-filter-pred-list), but returns the non-nil results of `fn` instead of Like [`-filter`](#-filter-pred-list), but returns the non-nil results of `fn` instead of
the corresponding elements of `list`. the corresponding elements of `list`.
Its anaphoric counterpart is `--keep`. Its anaphoric counterpart is `--keep`.
```el ```el
@ -894,6 +914,7 @@ Return the result of applying `fn` to `init` and the first element of
etc. If `list` is empty, return `init` without calling `fn`. etc. If `list` is empty, return `init` without calling `fn`.
This function's anaphoric counterpart is `--reduce-from`. This function's anaphoric counterpart is `--reduce-from`.
For other folds, see also [`-reduce`](#-reduce-fn-list) and [`-reduce-r`](#-reduce-r-fn-list). For other folds, see also [`-reduce`](#-reduce-fn-list) and [`-reduce-r`](#-reduce-r-fn-list).
```el ```el
@ -918,6 +939,7 @@ is like replacing the conses in `list` with applications of `fn`, and
its last link with `init`, and evaluating the resulting expression. its last link with `init`, and evaluating the resulting expression.
This function's anaphoric counterpart is `--reduce-r-from`. This function's anaphoric counterpart is `--reduce-r-from`.
For other folds, see also [`-reduce-r`](#-reduce-r-fn-list) and [`-reduce`](#-reduce-fn-list). For other folds, see also [`-reduce-r`](#-reduce-r-fn-list) and [`-reduce`](#-reduce-fn-list).
```el ```el
@ -936,6 +958,7 @@ If `list` is empty, return the result of calling `fn` with no
arguments. arguments.
This function's anaphoric counterpart is `--reduce`. This function's anaphoric counterpart is `--reduce`.
For other folds, see also [`-reduce-from`](#-reduce-from-fn-init-list) and [`-reduce-r`](#-reduce-r-fn-list). For other folds, see also [`-reduce-from`](#-reduce-from-fn-init-list) and [`-reduce-r`](#-reduce-r-fn-list).
```el ```el
@ -962,6 +985,7 @@ like replacing the conses in `list` with applications of `fn`,
ignoring its last link, and evaluating the resulting expression. ignoring its last link, and evaluating the resulting expression.
This function's anaphoric counterpart is `--reduce-r`. This function's anaphoric counterpart is `--reduce-r`.
For other folds, see also [`-reduce-r-from`](#-reduce-r-from-fn-init-list) and [`-reduce`](#-reduce-fn-list). For other folds, see also [`-reduce-r-from`](#-reduce-r-from-fn-init-list) and [`-reduce`](#-reduce-fn-list).
```el ```el
@ -976,7 +1000,9 @@ Return a list of `fn`'s intermediate reductions across `list`.
That is, a list of the intermediate values of the accumulator That is, a list of the intermediate values of the accumulator
when [`-reduce-from`](#-reduce-from-fn-init-list) (which see) is called with the same when [`-reduce-from`](#-reduce-from-fn-init-list) (which see) is called with the same
arguments. arguments.
This function's anaphoric counterpart is `--reductions-from`. This function's anaphoric counterpart is `--reductions-from`.
For other folds, see also [`-reductions`](#-reductions-fn-list) and [`-reductions-r`](#-reductions-r-fn-list). For other folds, see also [`-reductions`](#-reductions-fn-list) and [`-reductions-r`](#-reductions-r-fn-list).
```el ```el
@ -991,7 +1017,9 @@ Return a list of `fn`'s intermediate reductions across reversed `list`.
That is, a list of the intermediate values of the accumulator That is, a list of the intermediate values of the accumulator
when [`-reduce-r-from`](#-reduce-r-from-fn-init-list) (which see) is called with the same when [`-reduce-r-from`](#-reduce-r-from-fn-init-list) (which see) is called with the same
arguments. arguments.
This function's anaphoric counterpart is `--reductions-r-from`. This function's anaphoric counterpart is `--reductions-r-from`.
For other folds, see also [`-reductions`](#-reductions-fn-list) and [`-reductions-r`](#-reductions-r-fn-list). For other folds, see also [`-reductions`](#-reductions-fn-list) and [`-reductions-r`](#-reductions-r-fn-list).
```el ```el
@ -1005,7 +1033,9 @@ For other folds, see also [`-reductions`](#-reductions-fn-list) and [`-reduction
Return a list of `fn`'s intermediate reductions across `list`. Return a list of `fn`'s intermediate reductions across `list`.
That is, a list of the intermediate values of the accumulator That is, a list of the intermediate values of the accumulator
when [`-reduce`](#-reduce-fn-list) (which see) is called with the same arguments. when [`-reduce`](#-reduce-fn-list) (which see) is called with the same arguments.
This function's anaphoric counterpart is `--reductions`. This function's anaphoric counterpart is `--reductions`.
For other folds, see also [`-reductions`](#-reductions-fn-list) and [`-reductions-r`](#-reductions-r-fn-list). For other folds, see also [`-reductions`](#-reductions-fn-list) and [`-reductions-r`](#-reductions-r-fn-list).
```el ```el
@ -1019,7 +1049,9 @@ For other folds, see also [`-reductions`](#-reductions-fn-list) and [`-reduction
Return a list of `fn`'s intermediate reductions across reversed `list`. Return a list of `fn`'s intermediate reductions across reversed `list`.
That is, a list of the intermediate values of the accumulator That is, a list of the intermediate values of the accumulator
when [`-reduce-r`](#-reduce-r-fn-list) (which see) is called with the same arguments. when [`-reduce-r`](#-reduce-r-fn-list) (which see) is called with the same arguments.
This function's anaphoric counterpart is `--reductions-r`. This function's anaphoric counterpart is `--reductions-r`.
For other folds, see also [`-reductions-r-from`](#-reductions-r-from-fn-init-list) and For other folds, see also [`-reductions-r-from`](#-reductions-r-from-fn-init-list) and
[`-reductions`](#-reductions-fn-list). [`-reductions`](#-reductions-fn-list).
@ -1329,6 +1361,7 @@ Alias: `-is-infix-p`
Return non-nil if `obj` is a true cons pair. Return non-nil if `obj` is a true cons pair.
That is, a cons (`a` . `b`) where `b` is not a list. That is, a cons (`a` . `b`) where `b` is not a list.
Alias: `-cons-pair-p`. Alias: `-cons-pair-p`.
```el ```el
@ -1936,7 +1969,9 @@ See also: [`-flatten-n`](#-flatten-n-num-list), [`-table`](#-table-fn-rest-lists
Return the first item in `list` for which `pred` returns non-nil. Return the first item in `list` for which `pred` returns non-nil.
Return nil if no such element is found. Return nil if no such element is found.
To get the first item in the list no questions asked, use `car`. To get the first item in the list no questions asked, use `car`.
Alias: `-find`. Alias: `-find`.
This function's anaphoric counterpart is `--first`. This function's anaphoric counterpart is `--first`.
```el ```el
@ -1948,7 +1983,9 @@ This function's anaphoric counterpart is `--first`.
#### -some `(pred list)` #### -some `(pred list)`
Return (`pred` x) for the first `list` item where (`pred` x) is non-nil, else nil. Return (`pred` x) for the first `list` item where (`pred` x) is non-nil, else nil.
Alias: `-any`. Alias: `-any`.
This function's anaphoric counterpart is `--some`. This function's anaphoric counterpart is `--some`.
```el ```el
@ -2617,8 +2654,11 @@ Functions iterating over lists for side effect only.
Call `fn` on each element of `list`. Call `fn` on each element of `list`.
Return nil; this function is intended for side effects. Return nil; this function is intended for side effects.
Its anaphoric counterpart is `--each`. For access to the current
element's index in `list`, see [`-each-indexed`](#-each-indexed-list-fn). Its anaphoric counterpart is `--each`.
For access to the current element's index in `list`, see
[`-each-indexed`](#-each-indexed-list-fn).
```el ```el
(let (l) (-each '(1 2 3) (lambda (x) (push x l))) l) ;; => '(3 2 1) (let (l) (-each '(1 2 3) (lambda (x) (push x l))) l) ;; => '(3 2 1)
@ -2632,6 +2672,7 @@ Call `fn` on each `item` in `list`, while (`pred` `item`) is non-nil.
Once an `item` is reached for which `pred` returns nil, `fn` is no Once an `item` is reached for which `pred` returns nil, `fn` is no
longer called. Return nil; this function is intended for side longer called. Return nil; this function is intended for side
effects. effects.
Its anaphoric counterpart is `--each-while`. Its anaphoric counterpart is `--each-while`.
```el ```el
@ -2645,6 +2686,7 @@ Its anaphoric counterpart is `--each-while`.
Call `fn` on each index and element of `list`. Call `fn` on each index and element of `list`.
For each `item` at `index` in `list`, call (funcall `fn` `index` `item`). For each `item` at `index` in `list`, call (funcall `fn` `index` `item`).
Return nil; this function is intended for side effects. Return nil; this function is intended for side effects.
See also: [`-map-indexed`](#-map-indexed-fn-list). See also: [`-map-indexed`](#-map-indexed-fn-list).
```el ```el
@ -2657,6 +2699,7 @@ See also: [`-map-indexed`](#-map-indexed-fn-list).
Call `fn` on each element of `list` in reversed order. Call `fn` on each element of `list` in reversed order.
Return nil; this function is intended for side effects. Return nil; this function is intended for side effects.
Its anaphoric counterpart is `--each-r`. Its anaphoric counterpart is `--each-r`.
```el ```el
@ -2671,6 +2714,7 @@ Call `fn` on each `item` in reversed `list`, while (`pred` `item`) is non-nil.
Once an `item` is reached for which `pred` returns nil, `fn` is no Once an `item` is reached for which `pred` returns nil, `fn` is no
longer called. Return nil; this function is intended for side longer called. Return nil; this function is intended for side
effects. effects.
Its anaphoric counterpart is `--each-r-while`. Its anaphoric counterpart is `--each-r-while`.
```el ```el
@ -2685,6 +2729,7 @@ Call `fn` `num` times, presumably for side effects.
`fn` is called with a single argument on successive integers `fn` is called with a single argument on successive integers
running from 0, inclusive, to `num`, exclusive. `fn` is not called running from 0, inclusive, to `num`, exclusive. `fn` is not called
if `num` is less than 1. if `num` is less than 1.
This function's anaphoric counterpart is `--dotimes`. This function's anaphoric counterpart is `--dotimes`.
```el ```el

@ -68,8 +68,11 @@ This is the anaphoric counterpart to `-each'."
(defun -each (list fn) (defun -each (list fn)
"Call FN on each element of LIST. "Call FN on each element of LIST.
Return nil; this function is intended for side effects. Return nil; this function is intended for side effects.
Its anaphoric counterpart is `--each'. For access to the current
element's index in LIST, see `-each-indexed'." Its anaphoric counterpart is `--each'.
For access to the current element's index in LIST, see
`-each-indexed'."
(declare (indent 1)) (declare (indent 1))
(ignore (mapc fn list))) (ignore (mapc fn list)))
@ -79,6 +82,7 @@ element's index in LIST, see `-each-indexed'."
"Call FN on each index and element of LIST. "Call FN on each index and element of LIST.
For each ITEM at INDEX in LIST, call (funcall FN INDEX ITEM). For each ITEM at INDEX in LIST, call (funcall FN INDEX ITEM).
Return nil; this function is intended for side effects. Return nil; this function is intended for side effects.
See also: `-map-indexed'." See also: `-map-indexed'."
(declare (indent 1)) (declare (indent 1))
(--each list (funcall fn it-index it))) (--each list (funcall fn it-index it)))
@ -107,6 +111,7 @@ This is the anaphoric counterpart to `-each-while'."
Once an ITEM is reached for which PRED returns nil, FN is no Once an ITEM is reached for which PRED returns nil, FN is no
longer called. Return nil; this function is intended for side longer called. Return nil; this function is intended for side
effects. effects.
Its anaphoric counterpart is `--each-while'." Its anaphoric counterpart is `--each-while'."
(declare (indent 2)) (declare (indent 2))
(--each-while list (funcall pred it) (funcall fn it))) (--each-while list (funcall pred it) (funcall fn it)))
@ -136,6 +141,7 @@ This is the anaphoric counterpart to `-each-r'."
(defun -each-r (list fn) (defun -each-r (list fn)
"Call FN on each element of LIST in reversed order. "Call FN on each element of LIST in reversed order.
Return nil; this function is intended for side effects. Return nil; this function is intended for side effects.
Its anaphoric counterpart is `--each-r'." Its anaphoric counterpart is `--each-r'."
(--each-r list (funcall fn it))) (--each-r list (funcall fn it)))
@ -167,6 +173,7 @@ This is the anaphoric counterpart to `-each-r-while'."
Once an ITEM is reached for which PRED returns nil, FN is no Once an ITEM is reached for which PRED returns nil, FN is no
longer called. Return nil; this function is intended for side longer called. Return nil; this function is intended for side
effects. effects.
Its anaphoric counterpart is `--each-r-while'." Its anaphoric counterpart is `--each-r-while'."
(--each-r-while list (funcall pred it) (funcall fn it))) (--each-r-while list (funcall pred it) (funcall fn it)))
@ -192,12 +199,14 @@ This is the anaphoric counterpart to `-dotimes'."
FN is called with a single argument on successive integers FN is called with a single argument on successive integers
running from 0, inclusive, to NUM, exclusive. FN is not called running from 0, inclusive, to NUM, exclusive. FN is not called
if NUM is less than 1. if NUM is less than 1.
This function's anaphoric counterpart is `--dotimes'." This function's anaphoric counterpart is `--dotimes'."
(declare (indent 1)) (declare (indent 1))
(--dotimes num (funcall fn it))) (--dotimes num (funcall fn it)))
(defun -map (fn list) (defun -map (fn list)
"Apply FN to each item in LIST and return the list of results. "Apply FN to each item in LIST and return the list of results.
This function's anaphoric counterpart is `--map'." This function's anaphoric counterpart is `--map'."
(mapcar fn list)) (mapcar fn list))
@ -205,7 +214,6 @@ This function's anaphoric counterpart is `--map'."
"Eval FORM for each item in LIST and return the list of results. "Eval FORM for each item in LIST and return the list of results.
Each element of LIST in turn is bound to `it' before evaluating Each element of LIST in turn is bound to `it' before evaluating
FORM. FORM.
This is the anaphoric counterpart to `-map'." This is the anaphoric counterpart to `-map'."
(declare (debug (def-form form))) (declare (debug (def-form form)))
`(mapcar (lambda (it) (ignore it) ,form) ,list)) `(mapcar (lambda (it) (ignore it) ,form) ,list))
@ -233,6 +241,7 @@ LIST, then applying FN to that result and the second element,
etc. If LIST is empty, return INIT without calling FN. etc. If LIST is empty, return INIT without calling FN.
This function's anaphoric counterpart is `--reduce-from'. This function's anaphoric counterpart is `--reduce-from'.
For other folds, see also `-reduce' and `-reduce-r'." For other folds, see also `-reduce' and `-reduce-r'."
(--reduce-from (funcall fn acc it) init list)) (--reduce-from (funcall fn acc it) init list))
@ -261,6 +270,7 @@ If LIST is empty, return the result of calling FN with no
arguments. arguments.
This function's anaphoric counterpart is `--reduce'. This function's anaphoric counterpart is `--reduce'.
For other folds, see also `-reduce-from' and `-reduce-r'." For other folds, see also `-reduce-from' and `-reduce-r'."
(if list (if list
(-reduce-from fn (car list) (cdr list)) (-reduce-from fn (car list) (cdr list))
@ -291,6 +301,7 @@ is like replacing the conses in LIST with applications of FN, and
its last link with INIT, and evaluating the resulting expression. its last link with INIT, and evaluating the resulting expression.
This function's anaphoric counterpart is `--reduce-r-from'. This function's anaphoric counterpart is `--reduce-r-from'.
For other folds, see also `-reduce-r' and `-reduce'." For other folds, see also `-reduce-r' and `-reduce'."
(--reduce-r-from (funcall fn it acc) init list)) (--reduce-r-from (funcall fn it acc) init list))
@ -319,6 +330,7 @@ like replacing the conses in LIST with applications of FN,
ignoring its last link, and evaluating the resulting expression. ignoring its last link, and evaluating the resulting expression.
This function's anaphoric counterpart is `--reduce-r'. This function's anaphoric counterpart is `--reduce-r'.
For other folds, see also `-reduce-r-from' and `-reduce'." For other folds, see also `-reduce-r-from' and `-reduce'."
(if list (if list
(--reduce-r (funcall fn it acc) list) (--reduce-r (funcall fn it acc) list)
@ -341,7 +353,9 @@ This is the anaphoric counterpart to `-reductions-from'."
That is, a list of the intermediate values of the accumulator That is, a list of the intermediate values of the accumulator
when `-reduce-from' (which see) is called with the same when `-reduce-from' (which see) is called with the same
arguments. arguments.
This function's anaphoric counterpart is `--reductions-from'. This function's anaphoric counterpart is `--reductions-from'.
For other folds, see also `-reductions' and `-reductions-r'." For other folds, see also `-reductions' and `-reductions-r'."
(--reductions-from (funcall fn acc it) init list)) (--reductions-from (funcall fn acc it) init list))
@ -363,7 +377,9 @@ This is the anaphoric counterpart to `-reductions'."
"Return a list of FN's intermediate reductions across LIST. "Return a list of FN's intermediate reductions across LIST.
That is, a list of the intermediate values of the accumulator That is, a list of the intermediate values of the accumulator
when `-reduce' (which see) is called with the same arguments. when `-reduce' (which see) is called with the same arguments.
This function's anaphoric counterpart is `--reductions'. This function's anaphoric counterpart is `--reductions'.
For other folds, see also `-reductions' and `-reductions-r'." For other folds, see also `-reductions' and `-reductions-r'."
(if list (if list
(--reductions-from (funcall fn acc it) (car list) (cdr list)) (--reductions-from (funcall fn acc it) (car list) (cdr list))
@ -385,7 +401,9 @@ This is the anaphoric counterpart to `-reductions-r-from'."
That is, a list of the intermediate values of the accumulator That is, a list of the intermediate values of the accumulator
when `-reduce-r-from' (which see) is called with the same when `-reduce-r-from' (which see) is called with the same
arguments. arguments.
This function's anaphoric counterpart is `--reductions-r-from'. This function's anaphoric counterpart is `--reductions-r-from'.
For other folds, see also `-reductions' and `-reductions-r'." For other folds, see also `-reductions' and `-reductions-r'."
(--reductions-r-from (funcall fn it acc) init list)) (--reductions-r-from (funcall fn it acc) init list))
@ -409,7 +427,9 @@ This is the anaphoric counterpart to `-reductions-r'."
"Return a list of FN's intermediate reductions across reversed LIST. "Return a list of FN's intermediate reductions across reversed LIST.
That is, a list of the intermediate values of the accumulator That is, a list of the intermediate values of the accumulator
when `-reduce-r' (which see) is called with the same arguments. when `-reduce-r' (which see) is called with the same arguments.
This function's anaphoric counterpart is `--reductions-r'. This function's anaphoric counterpart is `--reductions-r'.
For other folds, see also `-reductions-r-from' and For other folds, see also `-reductions-r-from' and
`-reductions'." `-reductions'."
(if list (if list
@ -430,8 +450,11 @@ For the opposite operation, see also `--remove'."
(defun -filter (pred list) (defun -filter (pred list)
"Return a new list of the items in LIST for which PRED returns non-nil. "Return a new list of the items in LIST for which PRED returns non-nil.
Alias: `-select'. Alias: `-select'.
This function's anaphoric counterpart is `--filter'. This function's anaphoric counterpart is `--filter'.
For similar operations, see also `-keep' and `-remove'." For similar operations, see also `-keep' and `-remove'."
(--filter (funcall pred it) list)) (--filter (funcall pred it) list))
@ -449,8 +472,11 @@ For the opposite operation, see also `--filter'."
(defun -remove (pred list) (defun -remove (pred list)
"Return a new list of the items in LIST for which PRED returns nil. "Return a new list of the items in LIST for which PRED returns nil.
Alias: `-reject'. Alias: `-reject'.
This function's anaphoric counterpart is `--remove'. This function's anaphoric counterpart is `--remove'.
For similar operations, see also `-keep' and `-filter'." For similar operations, see also `-keep' and `-filter'."
(--remove (funcall pred it) list)) (--remove (funcall pred it) list))
@ -481,8 +507,11 @@ This is a non-destructive operation, but only the front of LIST
leading up to the removed item is a copy; the rest is LIST's leading up to the removed item is a copy; the rest is LIST's
original tail. If no item is removed, then the result is a original tail. If no item is removed, then the result is a
complete copy. complete copy.
Alias: `-reject-first'. Alias: `-reject-first'.
This function's anaphoric counterpart is `--remove-first'. This function's anaphoric counterpart is `--remove-first'.
See also `-map-first', `-remove-item', and `-remove-last'." See also `-map-first', `-remove-item', and `-remove-last'."
(--remove-first (funcall pred it) list)) (--remove-first (funcall pred it) list))
@ -502,8 +531,11 @@ This is the anaphoric counterpart to `-remove-last'."
"Remove the last item from LIST for which PRED returns non-nil. "Remove the last item from LIST for which PRED returns non-nil.
The result is a copy of LIST regardless of whether an element is The result is a copy of LIST regardless of whether an element is
removed. removed.
Alias: `-reject-last'. Alias: `-reject-last'.
This function's anaphoric counterpart is `--remove-last'. This function's anaphoric counterpart is `--remove-last'.
See also `-map-last', `-remove-item', and `-remove-first'." See also `-map-last', `-remove-item', and `-remove-first'."
(--remove-last (funcall pred it) list)) (--remove-last (funcall pred it) list))
@ -533,6 +565,7 @@ This is the anaphoric counterpart to `-keep'."
"Return a new list of the non-nil results of applying FN to each item in LIST. "Return a new list of the non-nil results of applying FN to each item in LIST.
Like `-filter', but returns the non-nil results of FN instead of Like `-filter', but returns the non-nil results of FN instead of
the corresponding elements of LIST. the corresponding elements of LIST.
Its anaphoric counterpart is `--keep'." Its anaphoric counterpart is `--keep'."
(--keep (funcall fn it) list)) (--keep (funcall fn it) list))
@ -561,6 +594,7 @@ This is like `-map', but FN takes two arguments: the index of the
current element within LIST, and the element itself. current element within LIST, and the element itself.
This function's anaphoric counterpart is `--map-indexed'. This function's anaphoric counterpart is `--map-indexed'.
For a side-effecting variant, see also `-each-indexed'." For a side-effecting variant, see also `-each-indexed'."
(--map-indexed (funcall fn it-index it) list)) (--map-indexed (funcall fn it-index it) list))
@ -773,7 +807,9 @@ This is the anaphoric counterpart to `-first'."
"Return the first item in LIST for which PRED returns non-nil. "Return the first item in LIST for which PRED returns non-nil.
Return nil if no such element is found. Return nil if no such element is found.
To get the first item in the list no questions asked, use `car'. To get the first item in the list no questions asked, use `car'.
Alias: `-find'. Alias: `-find'.
This function's anaphoric counterpart is `--first'." This function's anaphoric counterpart is `--first'."
(--first (funcall pred it) list)) (--first (funcall pred it) list))
@ -794,7 +830,9 @@ This is the anaphoric counterpart to `-some'."
(defun -some (pred list) (defun -some (pred list)
"Return (PRED x) for the first LIST item where (PRED x) is non-nil, else nil. "Return (PRED x) for the first LIST item where (PRED x) is non-nil, else nil.
Alias: `-any'. Alias: `-any'.
This function's anaphoric counterpart is `--some'." This function's anaphoric counterpart is `--some'."
(--some (funcall pred it) list)) (--some (funcall pred it) list))
@ -1011,7 +1049,9 @@ This is the anaphoric counterpart to `-take-while'."
PRED is a function of one argument. Return a new list of the PRED is a function of one argument. Return a new list of the
successive elements from the start of LIST for which PRED returns successive elements from the start of LIST for which PRED returns
non-nil. non-nil.
This function's anaphoric counterpart is `--take-while'. This function's anaphoric counterpart is `--take-while'.
For another variant, see also `-drop-while'." For another variant, see also `-drop-while'."
(--take-while (funcall pred it) list)) (--take-while (funcall pred it) list))
@ -1033,7 +1073,9 @@ This is the anaphoric counterpart to `-drop-while'."
PRED is a function of one argument. Return the tail (not a copy) PRED is a function of one argument. Return the tail (not a copy)
of LIST starting from its first element for which PRED returns of LIST starting from its first element for which PRED returns
nil. nil.
This function's anaphoric counterpart is `--drop-while'. This function's anaphoric counterpart is `--drop-while'.
For another variant, see also `-take-while'." For another variant, see also `-take-while'."
(--drop-while (funcall pred it) list)) (--drop-while (funcall pred it) list))
@ -1059,6 +1101,7 @@ See also: `-take'."
"Return the tail (not a copy) of LIST without the first N items. "Return the tail (not a copy) of LIST without the first N items.
Return nil if LIST contains N items or fewer. Return nil if LIST contains N items or fewer.
Return LIST if N is zero or less. Return LIST if N is zero or less.
For another variant, see also `-drop-last'. For another variant, see also `-drop-last'.
\n(fn N LIST)") \n(fn N LIST)")
@ -2787,6 +2830,7 @@ the new seed."
(defun -cons-pair? (obj) (defun -cons-pair? (obj)
"Return non-nil if OBJ is a true cons pair. "Return non-nil if OBJ is a true cons pair.
That is, a cons (A . B) where B is not a list. That is, a cons (A . B) where B is not a list.
Alias: `-cons-pair-p'." Alias: `-cons-pair-p'."
(declare (pure t) (side-effect-free t)) (declare (pure t) (side-effect-free t))
(nlistp (cdr-safe obj))) (nlistp (cdr-safe obj)))

@ -249,6 +249,7 @@ new list.
@anchor{-map} @anchor{-map}
@defun -map (fn list) @defun -map (fn list)
Apply @var{fn} to each item in @var{list} and return the list of results. Apply @var{fn} to each item in @var{list} and return the list of results.
This function's anaphoric counterpart is @code{--map}. This function's anaphoric counterpart is @code{--map}.
@example @example
@ -344,6 +345,7 @@ This is like @code{-map} (@pxref{-map}), but @var{fn} takes two arguments: the i
current element within @var{list}, and the element itself. current element within @var{list}, and the element itself.
This function's anaphoric counterpart is @code{--map-indexed}. This function's anaphoric counterpart is @code{--map-indexed}.
For a side-effecting variant, see also @code{-each-indexed} (@pxref{-each-indexed}). For a side-effecting variant, see also @code{-each-indexed} (@pxref{-each-indexed}).
@example @example
@ -478,8 +480,11 @@ Functions returning a sublist of the original list.
@anchor{-filter} @anchor{-filter}
@defun -filter (pred list) @defun -filter (pred list)
Return a new list of the items in @var{list} for which @var{pred} returns non-nil. Return a new list of the items in @var{list} for which @var{pred} returns non-nil.
Alias: @code{-select}. Alias: @code{-select}.
This function's anaphoric counterpart is @code{--filter}. This function's anaphoric counterpart is @code{--filter}.
For similar operations, see also @code{-keep} (@pxref{-keep}) and @code{-remove} (@pxref{-remove}). For similar operations, see also @code{-keep} (@pxref{-keep}) and @code{-remove} (@pxref{-remove}).
@example @example
@ -501,8 +506,11 @@ For similar operations, see also @code{-keep} (@pxref{-keep}) and @code{-remove}
@anchor{-remove} @anchor{-remove}
@defun -remove (pred list) @defun -remove (pred list)
Return a new list of the items in @var{list} for which @var{pred} returns nil. Return a new list of the items in @var{list} for which @var{pred} returns nil.
Alias: @code{-reject}. Alias: @code{-reject}.
This function's anaphoric counterpart is @code{--remove}. This function's anaphoric counterpart is @code{--remove}.
For similar operations, see also @code{-keep} (@pxref{-keep}) and @code{-filter} (@pxref{-filter}). For similar operations, see also @code{-keep} (@pxref{-keep}) and @code{-filter} (@pxref{-filter}).
@example @example
@ -528,8 +536,11 @@ This is a non-destructive operation, but only the front of @var{list}
leading up to the removed item is a copy; the rest is @var{list}'s leading up to the removed item is a copy; the rest is @var{list}'s
original tail. If no item is removed, then the result is a original tail. If no item is removed, then the result is a
complete copy. complete copy.
Alias: @code{-reject-first}. Alias: @code{-reject-first}.
This function's anaphoric counterpart is @code{--remove-first}. This function's anaphoric counterpart is @code{--remove-first}.
See also @code{-map-first} (@pxref{-map-first}), @code{-remove-item} (@pxref{-remove-item}), and @code{-remove-last} (@pxref{-remove-last}). See also @code{-map-first} (@pxref{-map-first}), @code{-remove-item} (@pxref{-remove-item}), and @code{-remove-last} (@pxref{-remove-last}).
@example @example
@ -553,8 +564,11 @@ See also @code{-map-first} (@pxref{-map-first}), @code{-remove-item} (@pxref{-re
Remove the last item from @var{list} for which @var{pred} returns non-nil. Remove the last item from @var{list} for which @var{pred} returns non-nil.
The result is a copy of @var{list} regardless of whether an element is The result is a copy of @var{list} regardless of whether an element is
removed. removed.
Alias: @code{-reject-last}. Alias: @code{-reject-last}.
This function's anaphoric counterpart is @code{--remove-last}. This function's anaphoric counterpart is @code{--remove-last}.
See also @code{-map-last} (@pxref{-map-last}), @code{-remove-item} (@pxref{-remove-item}), and @code{-remove-first} (@pxref{-remove-first}). See also @code{-map-last} (@pxref{-map-last}), @code{-remove-item} (@pxref{-remove-item}), and @code{-remove-first} (@pxref{-remove-first}).
@example @example
@ -693,6 +707,7 @@ See also: @code{-take} (@pxref{-take}).
Return the tail (not a copy) of @var{list} without the first @var{n} items. Return the tail (not a copy) of @var{list} without the first @var{n} items.
Return nil if @var{list} contains @var{n} items or fewer. Return nil if @var{list} contains @var{n} items or fewer.
Return @var{list} if @var{n} is zero or less. Return @var{list} if @var{n} is zero or less.
For another variant, see also @code{-drop-last} (@pxref{-drop-last}). For another variant, see also @code{-drop-last} (@pxref{-drop-last}).
@example @example
@ -741,7 +756,9 @@ Take successive items from @var{list} for which @var{pred} returns non-nil.
@var{pred} is a function of one argument. Return a new list of the @var{pred} is a function of one argument. Return a new list of the
successive elements from the start of @var{list} for which @var{pred} returns successive elements from the start of @var{list} for which @var{pred} returns
non-nil. non-nil.
This function's anaphoric counterpart is @code{--take-while}. This function's anaphoric counterpart is @code{--take-while}.
For another variant, see also @code{-drop-while} (@pxref{-drop-while}). For another variant, see also @code{-drop-while} (@pxref{-drop-while}).
@example @example
@ -766,7 +783,9 @@ Drop successive items from @var{list} for which @var{pred} returns non-nil.
@var{pred} is a function of one argument. Return the tail (not a copy) @var{pred} is a function of one argument. Return the tail (not a copy)
of @var{list} starting from its first element for which @var{pred} returns of @var{list} starting from its first element for which @var{pred} returns
nil. nil.
This function's anaphoric counterpart is @code{--drop-while}. This function's anaphoric counterpart is @code{--drop-while}.
For another variant, see also @code{-take-while} (@pxref{-take-while}). For another variant, see also @code{-take-while} (@pxref{-take-while}).
@example @example
@ -863,6 +882,7 @@ Functions returning a modified copy of the input list.
Return a new list of the non-nil results of applying @var{fn} to each item in @var{list}. Return a new list of the non-nil results of applying @var{fn} to each item in @var{list}.
Like @code{-filter} (@pxref{-filter}), but returns the non-nil results of @var{fn} instead of Like @code{-filter} (@pxref{-filter}), but returns the non-nil results of @var{fn} instead of
the corresponding elements of @var{list}. the corresponding elements of @var{list}.
Its anaphoric counterpart is @code{--keep}. Its anaphoric counterpart is @code{--keep}.
@example @example
@ -1146,6 +1166,7 @@ Return the result of applying @var{fn} to @var{init} and the first element of
etc. If @var{list} is empty, return @var{init} without calling @var{fn}. etc. If @var{list} is empty, return @var{init} without calling @var{fn}.
This function's anaphoric counterpart is @code{--reduce-from}. This function's anaphoric counterpart is @code{--reduce-from}.
For other folds, see also @code{-reduce} (@pxref{-reduce}) and @code{-reduce-r} (@pxref{-reduce-r}). For other folds, see also @code{-reduce} (@pxref{-reduce}) and @code{-reduce-r} (@pxref{-reduce-r}).
@example @example
@ -1180,6 +1201,7 @@ is like replacing the conses in @var{list} with applications of @var{fn}, and
its last link with @var{init}, and evaluating the resulting expression. its last link with @var{init}, and evaluating the resulting expression.
This function's anaphoric counterpart is @code{--reduce-r-from}. This function's anaphoric counterpart is @code{--reduce-r-from}.
For other folds, see also @code{-reduce-r} (@pxref{-reduce-r}) and @code{-reduce} (@pxref{-reduce}). For other folds, see also @code{-reduce-r} (@pxref{-reduce-r}) and @code{-reduce} (@pxref{-reduce}).
@example @example
@ -1208,6 +1230,7 @@ If @var{list} is empty, return the result of calling @var{fn} with no
arguments. arguments.
This function's anaphoric counterpart is @code{--reduce}. This function's anaphoric counterpart is @code{--reduce}.
For other folds, see also @code{-reduce-from} (@pxref{-reduce-from}) and @code{-reduce-r} (@pxref{-reduce-r}). For other folds, see also @code{-reduce-from} (@pxref{-reduce-from}) and @code{-reduce-r} (@pxref{-reduce-r}).
@example @example
@ -1244,6 +1267,7 @@ like replacing the conses in @var{list} with applications of @var{fn},
ignoring its last link, and evaluating the resulting expression. ignoring its last link, and evaluating the resulting expression.
This function's anaphoric counterpart is @code{--reduce-r}. This function's anaphoric counterpart is @code{--reduce-r}.
For other folds, see also @code{-reduce-r-from} (@pxref{-reduce-r-from}) and @code{-reduce} (@pxref{-reduce}). For other folds, see also @code{-reduce-r-from} (@pxref{-reduce-r-from}) and @code{-reduce} (@pxref{-reduce}).
@example @example
@ -1268,7 +1292,9 @@ Return a list of @var{fn}'s intermediate reductions across @var{list}.
That is, a list of the intermediate values of the accumulator That is, a list of the intermediate values of the accumulator
when @code{-reduce-from} (@pxref{-reduce-from}) (which see) is called with the same when @code{-reduce-from} (@pxref{-reduce-from}) (which see) is called with the same
arguments. arguments.
This function's anaphoric counterpart is @code{--reductions-from}. This function's anaphoric counterpart is @code{--reductions-from}.
For other folds, see also @code{-reductions} (@pxref{-reductions}) and @code{-reductions-r} (@pxref{-reductions-r}). For other folds, see also @code{-reductions} (@pxref{-reductions}) and @code{-reductions-r} (@pxref{-reductions-r}).
@example @example
@ -1293,7 +1319,9 @@ Return a list of @var{fn}'s intermediate reductions across reversed @var{list}.
That is, a list of the intermediate values of the accumulator That is, a list of the intermediate values of the accumulator
when @code{-reduce-r-from} (@pxref{-reduce-r-from}) (which see) is called with the same when @code{-reduce-r-from} (@pxref{-reduce-r-from}) (which see) is called with the same
arguments. arguments.
This function's anaphoric counterpart is @code{--reductions-r-from}. This function's anaphoric counterpart is @code{--reductions-r-from}.
For other folds, see also @code{-reductions} (@pxref{-reductions}) and @code{-reductions-r} (@pxref{-reductions-r}). For other folds, see also @code{-reductions} (@pxref{-reductions}) and @code{-reductions-r} (@pxref{-reductions-r}).
@example @example
@ -1317,7 +1345,9 @@ For other folds, see also @code{-reductions} (@pxref{-reductions}) and @code{-re
Return a list of @var{fn}'s intermediate reductions across @var{list}. Return a list of @var{fn}'s intermediate reductions across @var{list}.
That is, a list of the intermediate values of the accumulator That is, a list of the intermediate values of the accumulator
when @code{-reduce} (@pxref{-reduce}) (which see) is called with the same arguments. when @code{-reduce} (@pxref{-reduce}) (which see) is called with the same arguments.
This function's anaphoric counterpart is @code{--reductions}. This function's anaphoric counterpart is @code{--reductions}.
For other folds, see also @code{-reductions} (@pxref{-reductions}) and @code{-reductions-r} (@pxref{-reductions-r}). For other folds, see also @code{-reductions} (@pxref{-reductions}) and @code{-reductions-r} (@pxref{-reductions-r}).
@example @example
@ -1341,7 +1371,9 @@ For other folds, see also @code{-reductions} (@pxref{-reductions}) and @code{-re
Return a list of @var{fn}'s intermediate reductions across reversed @var{list}. Return a list of @var{fn}'s intermediate reductions across reversed @var{list}.
That is, a list of the intermediate values of the accumulator That is, a list of the intermediate values of the accumulator
when @code{-reduce-r} (@pxref{-reduce-r}) (which see) is called with the same arguments. when @code{-reduce-r} (@pxref{-reduce-r}) (which see) is called with the same arguments.
This function's anaphoric counterpart is @code{--reductions-r}. This function's anaphoric counterpart is @code{--reductions-r}.
For other folds, see also @code{-reductions-r-from} (@pxref{-reductions-r-from}) and For other folds, see also @code{-reductions-r-from} (@pxref{-reductions-r-from}) and
@code{-reductions} (@pxref{-reductions}). @code{-reductions} (@pxref{-reductions}).
@ -1900,6 +1932,7 @@ Alias: @code{-is-infix-p}
@defun -cons-pair? (obj) @defun -cons-pair? (obj)
Return non-nil if @var{obj} is a true cons pair. Return non-nil if @var{obj} is a true cons pair.
That is, a cons (@var{a} . @var{b}) where @var{b} is not a list. That is, a cons (@var{a} . @var{b}) where @var{b} is not a list.
Alias: @code{-cons-pair-p}. Alias: @code{-cons-pair-p}.
@example @example
@ -2956,7 +2989,9 @@ See also: @code{-flatten-n} (@pxref{-flatten-n}), @code{-table} (@pxref{-table})
Return the first item in @var{list} for which @var{pred} returns non-nil. Return the first item in @var{list} for which @var{pred} returns non-nil.
Return nil if no such element is found. Return nil if no such element is found.
To get the first item in the list no questions asked, use @code{car}. To get the first item in the list no questions asked, use @code{car}.
Alias: @code{-find}. Alias: @code{-find}.
This function's anaphoric counterpart is @code{--first}. This function's anaphoric counterpart is @code{--first}.
@example @example
@ -2978,7 +3013,9 @@ This function's anaphoric counterpart is @code{--first}.
@anchor{-some} @anchor{-some}
@defun -some (pred list) @defun -some (pred list)
Return (@var{pred} x) for the first @var{list} item where (@var{pred} x) is non-nil, else nil. Return (@var{pred} x) for the first @var{list} item where (@var{pred} x) is non-nil, else nil.
Alias: @code{-any}. Alias: @code{-any}.
This function's anaphoric counterpart is @code{--some}. This function's anaphoric counterpart is @code{--some}.
@example @example
@ -3981,8 +4018,11 @@ Functions iterating over lists for side effect only.
@defun -each (list fn) @defun -each (list fn)
Call @var{fn} on each element of @var{list}. Call @var{fn} on each element of @var{list}.
Return nil; this function is intended for side effects. Return nil; this function is intended for side effects.
Its anaphoric counterpart is @code{--each}. For access to the current
element's index in @var{list}, see @code{-each-indexed} (@pxref{-each-indexed}). Its anaphoric counterpart is @code{--each}.
For access to the current element's index in @var{list}, see
@code{-each-indexed} (@pxref{-each-indexed}).
@example @example
@group @group
@ -4006,6 +4046,7 @@ Call @var{fn} on each @var{item} in @var{list}, while (@var{pred} @var{item}) is
Once an @var{item} is reached for which @var{pred} returns nil, @var{fn} is no Once an @var{item} is reached for which @var{pred} returns nil, @var{fn} is no
longer called. Return nil; this function is intended for side longer called. Return nil; this function is intended for side
effects. effects.
Its anaphoric counterpart is @code{--each-while}. Its anaphoric counterpart is @code{--each-while}.
@example @example
@ -4029,6 +4070,7 @@ Its anaphoric counterpart is @code{--each-while}.
Call @var{fn} on each index and element of @var{list}. Call @var{fn} on each index and element of @var{list}.
For each @var{item} at @var{index} in @var{list}, call (funcall @var{fn} @var{index} @var{item}). For each @var{item} at @var{index} in @var{list}, call (funcall @var{fn} @var{index} @var{item}).
Return nil; this function is intended for side effects. Return nil; this function is intended for side effects.
See also: @code{-map-indexed} (@pxref{-map-indexed}). See also: @code{-map-indexed} (@pxref{-map-indexed}).
@example @example
@ -4051,6 +4093,7 @@ See also: @code{-map-indexed} (@pxref{-map-indexed}).
@defun -each-r (list fn) @defun -each-r (list fn)
Call @var{fn} on each element of @var{list} in reversed order. Call @var{fn} on each element of @var{list} in reversed order.
Return nil; this function is intended for side effects. Return nil; this function is intended for side effects.
Its anaphoric counterpart is @code{--each-r}. Its anaphoric counterpart is @code{--each-r}.
@example @example
@ -4075,6 +4118,7 @@ Call @var{fn} on each @var{item} in reversed @var{list}, while (@var{pred} @var{
Once an @var{item} is reached for which @var{pred} returns nil, @var{fn} is no Once an @var{item} is reached for which @var{pred} returns nil, @var{fn} is no
longer called. Return nil; this function is intended for side longer called. Return nil; this function is intended for side
effects. effects.
Its anaphoric counterpart is @code{--each-r-while}. Its anaphoric counterpart is @code{--each-r-while}.
@example @example
@ -4099,6 +4143,7 @@ Call @var{fn} @var{num} times, presumably for side effects.
@var{fn} is called with a single argument on successive integers @var{fn} is called with a single argument on successive integers
running from 0, inclusive, to @var{num}, exclusive. @var{fn} is not called running from 0, inclusive, to @var{num}, exclusive. @var{fn} is not called
if @var{num} is less than 1. if @var{num} is less than 1.
This function's anaphoric counterpart is @code{--dotimes}. This function's anaphoric counterpart is @code{--dotimes}.
@example @example

Loading…
Cancel
Save