Skip to content

Commit

Permalink
Mark functions with important-return-value
Browse files Browse the repository at this point in the history
* dash.el: Include important-return-value in
defun-declarations-alist as needed to pacify warnings in Emacs < 30.

(-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)
(-map-when, -map-first, -map-last, -mapcat, -iterate, -splice)
(-splice-list, -first, -some, -every, -last, -count, -any?, -all?)
(-none?, -only-some?, -take-while, -drop-while, -update-at)
(-split-with, -split-when, -separate, -partition-by)
(-partition-by-header, -partition-after-pred)
(-partition-before-pred, -group-by, -zip-with, -annotate, -table)
(-table-flat, -find-index, -find-indices, -find-last-index)
(-grade-up, -grade-down, -distinct, -union, -intersection)
(-difference, -frequencies, -permutations, -contains?, -same-items?)
(-sort, -max-by, -min-by, -fix, -unfold, -tree-mapreduce-from)
(-tree-mapreduce, -tree-map, -tree-reduce-from, -tree-reduce)
(-tree-seq, -fixfn): Mark as having important-return-value.

(-snoc, -partition-after-item, -partition-before-item, -powerset)
(-inits, -tails, -common-suffix, -iteratefn, -counter): Declare pure
and side-effect-free.

* dev/examples.el (-every, -sort): Pacify unused value warnings.

* README.md:
* dash.texi: Regenerate docs.
  • Loading branch information
basil-conto committed May 2, 2023
1 parent b6eef1a commit 96eaba0
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 21 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -1173,7 +1173,7 @@ Return all prefixes of `list`.

#### -tails `(list)`

Return all suffixes of `list`
Return all suffixes of `list`.

```el
(-tails '(1 2 3 4)) ;; => ((1 2 3 4) (2 3 4) (3 4) (4) nil)
Expand Down Expand Up @@ -2312,8 +2312,8 @@ Return the sorted list. `list` is `not` modified by side effects.
if the first element should sort before the second.

```el
(-sort '< '(3 1 2)) ;; => (1 2 3)
(-sort '> '(3 1 2)) ;; => (3 2 1)
(-sort #'< '(3 1 2)) ;; => (1 2 3)
(-sort #'> '(3 1 2)) ;; => (3 2 1)
(--sort (< it other) '(3 1 2)) ;; => (1 2 3)
```

Expand Down

0 comments on commit 96eaba0

Please sign in to comment.