Release 2.16.0

master
Matus Goljer 7 years ago
parent 15498602f4
commit 258c324d98
No known key found for this signature in database
GPG Key ID: FA5A172CF1800B80
  1. 49
      README.md
  2. 2
      dash.el
  3. 441
      dash.info
  4. 53
      dash.texi
  5. 7
      readme-template.md

@ -19,11 +19,11 @@ If you want the function combinators, then also:
Add this to the big comment block at the top: Add this to the big comment block at the top:
;; Package-Requires: ((dash "2.15.0")) ;; Package-Requires: ((dash "2.16.0"))
To get function combinators: To get function combinators:
;; Package-Requires: ((dash "2.15.0") (dash-functional "1.2.0") (emacs "24")) ;; Package-Requires: ((dash "2.16.0") (dash-functional "1.2.0") (emacs "24"))
## Upcoming breaking change! ## Upcoming breaking change!
@ -147,6 +147,7 @@ Functions reducing lists into single value.
* [-inits](#-inits-list) `(list)` * [-inits](#-inits-list) `(list)`
* [-tails](#-tails-list) `(list)` * [-tails](#-tails-list) `(list)`
* [-common-prefix](#-common-prefix-rest-lists) `(&rest lists)` * [-common-prefix](#-common-prefix-rest-lists) `(&rest lists)`
* [-common-suffix](#-common-suffix-rest-lists) `(&rest lists)`
* [-min](#-min-list) `(list)` * [-min](#-min-list) `(list)`
* [-min-by](#-min-by-comparator-list) `(comparator list)` * [-min-by](#-min-by-comparator-list) `(comparator list)`
* [-max](#-max-list) `(list)` * [-max](#-max-list) `(list)`
@ -302,6 +303,7 @@ Functions iterating over lists for side-effect only.
* [-each-r-while](#-each-r-while-list-pred-fn) `(list pred fn)` * [-each-r-while](#-each-r-while-list-pred-fn) `(list pred fn)`
* [-dotimes](#-dotimes-num-fn) `(num fn)` * [-dotimes](#-dotimes-num-fn) `(num fn)`
* [-doto](#-doto-eval-initial-value-rest-forms) `(eval-initial-value &rest forms)` * [-doto](#-doto-eval-initial-value-rest-forms) `(eval-initial-value &rest forms)`
* [--doto](#--doto-eval-initial-value-rest-forms) `(eval-initial-value &rest forms)`
### Destructive operations ### Destructive operations
@ -1052,10 +1054,20 @@ Return the longest common prefix of `lists`.
```el ```el
(-common-prefix '(1)) ;; => '(1) (-common-prefix '(1)) ;; => '(1)
(-common-prefix '(1 2) nil '(1 2)) ;; => nil (-common-prefix '(1 2) '(3 4) '(1 2)) ;; => nil
(-common-prefix '(1 2) '(1 2 3) '(1 2 3 4)) ;; => '(1 2) (-common-prefix '(1 2) '(1 2 3) '(1 2 3 4)) ;; => '(1 2)
``` ```
#### -common-suffix `(&rest lists)`
Return the longest common suffix of `lists`.
```el
(-common-suffix '(1)) ;; => '(1)
(-common-suffix '(1 2) '(3 4) '(1 2)) ;; => nil
(-common-suffix '(1 2 3 4) '(2 3 4) '(3 4)) ;; => '(3 4)
```
#### -min `(list)` #### -min `(list)`
Return the smallest value from `list` of numbers or markers. Return the smallest value from `list` of numbers or markers.
@ -1405,9 +1417,9 @@ other value (the body).
Partition directly after each time `pred` is true on an element of `list`. Partition directly after each time `pred` is true on an element of `list`.
```el ```el
(-partition-after-pred #'oddp '()) ;; => '() (-partition-after-pred (function oddp) '()) ;; => '()
(-partition-after-pred #'oddp '(1)) ;; => '((1)) (-partition-after-pred (function oddp) '(1)) ;; => '((1))
(-partition-after-pred #'oddp '(0 1)) ;; => '((0 1)) (-partition-after-pred (function oddp) '(0 1)) ;; => '((0 1))
``` ```
#### -partition-before-pred `(pred list)` #### -partition-before-pred `(pred list)`
@ -1415,9 +1427,9 @@ Partition directly after each time `pred` is true on an element of `list`.
Partition directly before each time `pred` is true on an element of `list`. Partition directly before each time `pred` is true on an element of `list`.
```el ```el
(-partition-before-pred #'oddp '()) ;; => '() (-partition-before-pred (function oddp) '()) ;; => '()
(-partition-before-pred #'oddp '(1)) ;; => '((1)) (-partition-before-pred (function oddp) '(1)) ;; => '((1))
(-partition-before-pred #'oddp '(0 1)) ;; => '((0) (1)) (-partition-before-pred (function oddp) '(0 1)) ;; => '((0) (1))
``` ```
#### -partition-before-item `(item list)` #### -partition-before-item `(item list)`
@ -1629,6 +1641,7 @@ The time complexity is `o`(n).
```el ```el
(-rotate 3 '(1 2 3 4 5 6 7)) ;; => '(5 6 7 1 2 3 4) (-rotate 3 '(1 2 3 4 5 6 7)) ;; => '(5 6 7 1 2 3 4)
(-rotate -3 '(1 2 3 4 5 6 7)) ;; => '(4 5 6 7 1 2 3) (-rotate -3 '(1 2 3 4 5 6 7)) ;; => '(4 5 6 7 1 2 3)
(-rotate 16 '(1 2 3 4 5 6 7)) ;; => '(6 7 1 2 3 4 5)
``` ```
#### -repeat `(n x)` #### -repeat `(n x)`
@ -2574,6 +2587,15 @@ the target form.
(-doto '(1 . 2) (setcar 3) (setcdr 4)) ;; => '(3 . 4) (-doto '(1 . 2) (setcar 3) (setcdr 4)) ;; => '(3 . 4)
``` ```
#### --doto `(eval-initial-value &rest forms)`
Anaphoric form of [`-doto`](#-doto-eval-initial-value-rest-forms).
Note: `it` is not required in each form.
```el
(gethash "key" (--doto (make-hash-table :test 'equal) (puthash "key" "value" it))) ;; => "value"
```
## Destructive operations ## Destructive operations
@ -2658,7 +2680,7 @@ expects a list with n items as arguments
```el ```el
(-map (-applify '+) '((1 1 1) (1 2 3) (5 5 5))) ;; => '(3 6 15) (-map (-applify '+) '((1 1 1) (1 2 3) (5 5 5))) ;; => '(3 6 15)
(-map (-applify (lambda (a b c) `(,a (,b (,c))))) '((1 1 1) (1 2 3) (5 5 5))) ;; => '((1 (1 (1))) (1 (2 (3))) (5 (5 (5)))) (-map (-applify (lambda (a b c) (\` ((\, a) ((\, b) ((\, c))))))) '((1 1 1) (1 2 3) (5 5 5))) ;; => '((1 (1 (1))) (1 (2 (3))) (5 (5 (5))))
(funcall (-applify '<) '(3 6)) ;; => t (funcall (-applify '<) '(3 6)) ;; => t
``` ```
@ -2856,6 +2878,13 @@ Change `readme-template.md` or `examples-to-docs.el` instead.
## Changelist ## Changelist
### From 2.15 to 2.16
- Added `--doto`, anaphoric version of `-doto` (#282)
- Aliased `-cons-pair-p` to `-cons-pair?`(#288)
- Generalized `-rotate` for |n| greater than the length of the list (@leungbk, #290)
- Added a mechanism to extend destructuring with custom matchers (@yyoncho, #277)
### From 2.14 to 2.15 ### From 2.14 to 2.15
This release brings new destructuring features, some new control flow This release brings new destructuring features, some new control flow

@ -3,7 +3,7 @@
;; Copyright (C) 2012-2016 Free Software Foundation, Inc. ;; Copyright (C) 2012-2016 Free Software Foundation, Inc.
;; Author: Magnar Sveen <magnars@gmail.com> ;; Author: Magnar Sveen <magnars@gmail.com>
;; Version: 2.15.0 ;; Version: 2.16.0
;; Keywords: lists ;; Keywords: lists
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify

@ -942,11 +942,21 @@ Functions reducing lists into single value.
(-common-prefix '(1)) (-common-prefix '(1))
⇒ '(1) ⇒ '(1)
(-common-prefix '(1 2) nil '(1 2)) (-common-prefix '(1 2) '(3 4) '(1 2))
⇒ nil ⇒ nil
(-common-prefix '(1 2) '(1 2 3) '(1 2 3 4)) (-common-prefix '(1 2) '(1 2 3) '(1 2 3 4))
⇒ '(1 2) ⇒ '(1 2)
-- Function: -common-suffix (&rest lists)
Return the longest common suffix of LISTS.
(-common-suffix '(1))
⇒ '(1)
(-common-suffix '(1 2) '(3 4) '(1 2))
⇒ nil
(-common-suffix '(1 2 3 4) '(2 3 4) '(3 4))
⇒ '(3 4)
-- Function: -min (list) -- Function: -min (list)
Return the smallest value from LIST of numbers or markers. Return the smallest value from LIST of numbers or markers.
@ -1312,22 +1322,22 @@ Functions partitioning the input list into a list of lists.
Partition directly after each time PRED is true on an element of Partition directly after each time PRED is true on an element of
LIST. LIST.
(-partition-after-pred #'oddp '()) (-partition-after-pred (function oddp) '())
⇒ '() ⇒ '()
(-partition-after-pred #'oddp '(1)) (-partition-after-pred (function oddp) '(1))
⇒ '((1)) ⇒ '((1))
(-partition-after-pred #'oddp '(0 1)) (-partition-after-pred (function oddp) '(0 1))
⇒ '((0 1)) ⇒ '((0 1))
-- Function: -partition-before-pred (pred list) -- Function: -partition-before-pred (pred list)
Partition directly before each time PRED is true on an element of Partition directly before each time PRED is true on an element of
LIST. LIST.
(-partition-before-pred #'oddp '()) (-partition-before-pred (function oddp) '())
⇒ '() ⇒ '()
(-partition-before-pred #'oddp '(1)) (-partition-before-pred (function oddp) '(1))
⇒ '((1)) ⇒ '((1))
(-partition-before-pred #'oddp '(0 1)) (-partition-before-pred (function oddp) '(0 1))
⇒ '((0) (1)) ⇒ '((0) (1))
-- Function: -partition-before-item (item list) -- Function: -partition-before-item (item list)
@ -1542,6 +1552,8 @@ Other list functions not fit to be classified elsewhere.
⇒ '(5 6 7 1 2 3 4) ⇒ '(5 6 7 1 2 3 4)
(-rotate -3 '(1 2 3 4 5 6 7)) (-rotate -3 '(1 2 3 4 5 6 7))
⇒ '(4 5 6 7 1 2 3) ⇒ '(4 5 6 7 1 2 3)
(-rotate 16 '(1 2 3 4 5 6 7))
⇒ '(6 7 1 2 3 4 5)
-- Function: -repeat (n x) -- Function: -repeat (n x)
Return a list with X repeated N times. Return nil if N is less Return a list with X repeated N times. Return nil if N is less
@ -2494,6 +2506,13 @@ Functions iterating over lists for side-effect only.
(-doto '(1 . 2) (setcar 3) (setcdr 4)) (-doto '(1 . 2) (setcar 3) (setcdr 4))
⇒ '(3 . 4) ⇒ '(3 . 4)
-- Macro: --doto (eval-initial-value &rest forms)
Anaphoric form of ‘-doto’ (*note -doto::). Note: ‘it’ is not
required in each form.
(gethash "key" (--doto (make-hash-table :test 'equal) (puthash "key" "value" it)))
⇒ "value"
 
File: dash.info, Node: Destructive operations, Next: Function combinators, Prev: Side-effects, Up: Functions File: dash.info, Node: Destructive operations, Next: Function combinators, Prev: Side-effects, Up: Functions
@ -2578,7 +2597,7 @@ offered in a separate package: ‘dash-functional‘.
(-map (-applify '+) '((1 1 1) (1 2 3) (5 5 5))) (-map (-applify '+) '((1 1 1) (1 2 3) (5 5 5)))
⇒ '(3 6 15) ⇒ '(3 6 15)
(-map (-applify (lambda (a b c) `(,a (,b (,c))))) '((1 1 1) (1 2 3) (5 5 5))) (-map (-applify (lambda (a b c) (\` ((\, a) ((\, b) ((\, c))))))) '((1 1 1) (1 2 3) (5 5 5)))
⇒ '((1 (1 (1))) (1 (2 (3))) (5 (5 (5)))) ⇒ '((1 (1 (1))) (1 (2 (3))) (5 (5 (5))))
(funcall (-applify '<) '(3 6)) (funcall (-applify '<) '(3 6))
⇒ t ⇒ t
@ -2947,6 +2966,7 @@ Index
* !cons: Destructive operations. * !cons: Destructive operations.
(line 6) (line 6)
* -->: Threading macros. (line 32) * -->: Threading macros. (line 32)
* --doto: Side-effects. (line 81)
* ->: Threading macros. (line 6) * ->: Threading macros. (line 6)
* ->>: Threading macros. (line 19) * ->>: Threading macros. (line 19)
* -all?: Predicates. (line 18) * -all?: Predicates. (line 18)
@ -2958,14 +2978,15 @@ Index
(line 56) (line 56)
* -as->: Threading macros. (line 47) * -as->: Threading macros. (line 47)
* -butlast: Other list operations. * -butlast: Other list operations.
(line 311) (line 313)
* -clone: Tree operations. (line 123) * -clone: Tree operations. (line 123)
* -common-prefix: Reductions. (line 224) * -common-prefix: Reductions. (line 224)
* -common-suffix: Reductions. (line 234)
* -compose: Function combinators. * -compose: Function combinators.
(line 42) (line 42)
* -concat: List to list. (line 22) * -concat: List to list. (line 22)
* -cons*: Other list operations. * -cons*: Other list operations.
(line 28) (line 30)
* -const: Function combinators. * -const: Function combinators.
(line 93) (line 93)
* -contains?: Predicates. (line 57) * -contains?: Predicates. (line 57)
@ -2974,7 +2995,7 @@ Index
* -cut: Function combinators. * -cut: Function combinators.
(line 106) (line 106)
* -cycle: Other list operations. * -cycle: Other list operations.
(line 139) (line 141)
* -difference: Set operations. (line 20) * -difference: Set operations. (line 20)
* -distinct: Set operations. (line 62) * -distinct: Set operations. (line 62)
* -dotimes: Side-effects. (line 61) * -dotimes: Side-effects. (line 61)
@ -2990,17 +3011,17 @@ Index
* -elem-index: Indexing. (line 9) * -elem-index: Indexing. (line 9)
* -elem-indices: Indexing. (line 21) * -elem-indices: Indexing. (line 21)
* -fifth-item: Other list operations. * -fifth-item: Other list operations.
(line 291) (line 293)
* -filter: Sublist selection. (line 8) * -filter: Sublist selection. (line 8)
* -find-index: Indexing. (line 32) * -find-index: Indexing. (line 32)
* -find-indices: Indexing. (line 60) * -find-indices: Indexing. (line 60)
* -find-last-index: Indexing. (line 46) * -find-last-index: Indexing. (line 46)
* -first: Other list operations. * -first: Other list operations.
(line 205) (line 207)
* -first-item: Other list operations. * -first-item: Other list operations.
(line 242) (line 244)
* -fix: Other list operations. * -fix: Other list operations.
(line 347) (line 349)
* -fixfn: Function combinators. * -fixfn: Function combinators.
(line 177) (line 177)
* -flatten: List to list. (line 33) * -flatten: List to list. (line 33)
@ -3008,7 +3029,7 @@ Index
* -flip: Function combinators. * -flip: Function combinators.
(line 81) (line 81)
* -fourth-item: Other list operations. * -fourth-item: Other list operations.
(line 281) (line 283)
* -grade-down: Indexing. (line 81) * -grade-down: Indexing. (line 81)
* -grade-up: Indexing. (line 71) * -grade-up: Indexing. (line 71)
* -group-by: Partitioning. (line 187) * -group-by: Partitioning. (line 187)
@ -3017,9 +3038,9 @@ Index
* -inits: Reductions. (line 204) * -inits: Reductions. (line 204)
* -insert-at: List to list. (line 109) * -insert-at: List to list. (line 109)
* -interleave: Other list operations. * -interleave: Other list operations.
(line 66) (line 68)
* -interpose: Other list operations. * -interpose: Other list operations.
(line 56) (line 58)
* -intersection: Set operations. (line 32) * -intersection: Set operations. (line 32)
* -is-infix?: Predicates. (line 110) * -is-infix?: Predicates. (line 110)
* -is-prefix?: Predicates. (line 86) * -is-prefix?: Predicates. (line 86)
@ -3032,23 +3053,23 @@ Index
* -keep: List to list. (line 8) * -keep: List to list. (line 8)
* -lambda: Binding. (line 253) * -lambda: Binding. (line 253)
* -last: Other list operations. * -last: Other list operations.
(line 232) (line 234)
* -last-item: Other list operations. * -last-item: Other list operations.
(line 301) (line 303)
* -let: Binding. (line 66) * -let: Binding. (line 66)
* -let*: Binding. (line 233) * -let*: Binding. (line 233)
* -list: Other list operations. * -list: Other list operations.
(line 334) (line 336)
* -map: Maps. (line 10) * -map: Maps. (line 10)
* -map-first: Maps. (line 38) * -map-first: Maps. (line 38)
* -map-indexed: Maps. (line 66) * -map-indexed: Maps. (line 66)
* -map-last: Maps. (line 52) * -map-last: Maps. (line 52)
* -map-when: Maps. (line 21) * -map-when: Maps. (line 21)
* -mapcat: Maps. (line 124) * -mapcat: Maps. (line 124)
* -max: Reductions. (line 258) * -max: Reductions. (line 268)
* -max-by: Reductions. (line 268) * -max-by: Reductions. (line 278)
* -min: Reductions. (line 234) * -min: Reductions. (line 244)
* -min-by: Reductions. (line 244) * -min-by: Reductions. (line 254)
* -non-nil: Sublist selection. (line 80) * -non-nil: Sublist selection. (line 80)
* -none?: Predicates. (line 30) * -none?: Predicates. (line 30)
* -not: Function combinators. * -not: Function combinators.
@ -3059,7 +3080,7 @@ Index
* -orfn: Function combinators. * -orfn: Function combinators.
(line 128) (line 128)
* -pad: Other list operations. * -pad: Other list operations.
(line 150) (line 152)
* -partial: Function combinators. * -partial: Function combinators.
(line 9) (line 9)
* -partition: Partitioning. (line 74) * -partition: Partitioning. (line 74)
@ -3092,7 +3113,7 @@ Index
* -remove-item: Sublist selection. (line 68) * -remove-item: Sublist selection. (line 68)
* -remove-last: Sublist selection. (line 53) * -remove-last: Sublist selection. (line 53)
* -repeat: Other list operations. * -repeat: Other list operations.
(line 17) (line 19)
* -replace: List to list. (line 67) * -replace: List to list. (line 67)
* -replace-at: List to list. (line 120) * -replace-at: List to list. (line 120)
* -replace-first: List to list. (line 81) * -replace-first: List to list. (line 81)
@ -3105,7 +3126,7 @@ Index
* -running-sum: Reductions. (line 170) * -running-sum: Reductions. (line 170)
* -same-items?: Predicates. (line 72) * -same-items?: Predicates. (line 72)
* -second-item: Other list operations. * -second-item: Other list operations.
(line 257) (line 259)
* -select-by-indices: Sublist selection. (line 169) * -select-by-indices: Sublist selection. (line 169)
* -select-column: Sublist selection. (line 199) * -select-column: Sublist selection. (line 199)
* -select-columns: Sublist selection. (line 180) * -select-columns: Sublist selection. (line 180)
@ -3113,14 +3134,14 @@ Index
* -setq: Binding. (line 276) * -setq: Binding. (line 276)
* -slice: Sublist selection. (line 86) * -slice: Sublist selection. (line 86)
* -snoc: Other list operations. * -snoc: Other list operations.
(line 42) (line 44)
* -some: Other list operations. * -some: Other list operations.
(line 219) (line 221)
* -some-->: Threading macros. (line 84) * -some-->: Threading macros. (line 84)
* -some->: Threading macros. (line 60) * -some->: Threading macros. (line 60)
* -some->>: Threading macros. (line 72) * -some->>: Threading macros. (line 72)
* -sort: Other list operations. * -sort: Other list operations.
(line 321) (line 323)
* -splice: Maps. (line 91) * -splice: Maps. (line 91)
* -splice-list: Maps. (line 111) * -splice-list: Maps. (line 111)
* -split-at: Partitioning. (line 8) * -split-at: Partitioning. (line 8)
@ -3129,15 +3150,15 @@ Index
* -split-with: Partitioning. (line 17) * -split-with: Partitioning. (line 17)
* -sum: Reductions. (line 160) * -sum: Reductions. (line 160)
* -table: Other list operations. * -table: Other list operations.
(line 161) (line 163)
* -table-flat: Other list operations. * -table-flat: Other list operations.
(line 180) (line 182)
* -tails: Reductions. (line 214) * -tails: Reductions. (line 214)
* -take: Sublist selection. (line 102) * -take: Sublist selection. (line 102)
* -take-last: Sublist selection. (line 113) * -take-last: Sublist selection. (line 113)
* -take-while: Sublist selection. (line 147) * -take-while: Sublist selection. (line 147)
* -third-item: Other list operations. * -third-item: Other list operations.
(line 269) (line 271)
* -tree-map: Tree operations. (line 28) * -tree-map: Tree operations. (line 28)
* -tree-map-nodes: Tree operations. (line 39) * -tree-map-nodes: Tree operations. (line 39)
* -tree-mapreduce: Tree operations. (line 85) * -tree-mapreduce: Tree operations. (line 85)
@ -3148,16 +3169,16 @@ Index
* -unfold: Unfolding. (line 25) * -unfold: Unfolding. (line 25)
* -union: Set operations. (line 8) * -union: Set operations. (line 8)
* -unzip: Other list operations. * -unzip: Other list operations.
(line 122) (line 124)
* -update-at: List to list. (line 133) * -update-at: List to list. (line 133)
* -when-let: Binding. (line 9) * -when-let: Binding. (line 9)
* -when-let*: Binding. (line 23) * -when-let*: Binding. (line 23)
* -zip: Other list operations. * -zip: Other list operations.
(line 93) (line 95)
* -zip-fill: Other list operations. * -zip-fill: Other list operations.
(line 114) (line 116)
* -zip-with: Other list operations. * -zip-with: Other list operations.
(line 77) (line 79)
 
@ -3189,177 +3210,179 @@ Ref: -slice12579
Ref: -take13111 Ref: -take13111
Ref: -take-last13419 Ref: -take-last13419
Ref: -drop13742 Ref: -drop13742
Ref: -drop-last14016 Ref: -drop-last14015
Ref: -take-while14277 Ref: -take-while14275
Ref: -drop-while14628 Ref: -drop-while14625
Ref: -select-by-indices14984 Ref: -select-by-indices14981
Ref: -select-columns15498 Ref: -select-columns15495
Ref: -select-column16203 Ref: -select-column16200
Node: List to list16666 Node: List to list16663
Ref: -keep16858 Ref: -keep16855
Ref: -concat17361 Ref: -concat17358
Ref: -flatten17658 Ref: -flatten17655
Ref: -flatten-n18417 Ref: -flatten-n18414
Ref: -replace18804 Ref: -replace18801
Ref: -replace-first19267 Ref: -replace-first19264
Ref: -replace-last19763 Ref: -replace-last19760
Ref: -insert-at20252 Ref: -insert-at20249
Ref: -replace-at20579 Ref: -replace-at20576
Ref: -update-at20974 Ref: -update-at20971
Ref: -remove-at21465 Ref: -remove-at21462
Ref: -remove-at-indices21953 Ref: -remove-at-indices21950
Node: Reductions22535 Node: Reductions22532
Ref: -reduce-from22704 Ref: -reduce-from22701
Ref: -reduce-r-from23470 Ref: -reduce-r-from23467
Ref: -reduce24237 Ref: -reduce24234
Ref: -reduce-r24971 Ref: -reduce-r24968
Ref: -reductions-from25841 Ref: -reductions-from25838
Ref: -reductions-r-from26556 Ref: -reductions-r-from26553
Ref: -reductions27281 Ref: -reductions27278
Ref: -reductions-r27906 Ref: -reductions-r27903
Ref: -count28541 Ref: -count28538
Ref: -sum28765 Ref: -sum28762
Ref: -running-sum28955 Ref: -running-sum28951
Ref: -product29249 Ref: -product29244
Ref: -running-product29459 Ref: -running-product29453
Ref: -inits29773 Ref: -inits29766
Ref: -tails30021 Ref: -tails30014
Ref: -common-prefix30268 Ref: -common-prefix30261
Ref: -min30562 Ref: -common-suffix30558
Ref: -min-by30788 Ref: -min30855
Ref: -max31311 Ref: -min-by31081
Ref: -max-by31536 Ref: -max31604
Node: Unfolding32064 Ref: -max-by31829
Ref: -iterate32303 Node: Unfolding32357
Ref: -unfold32748 Ref: -iterate32596
Node: Predicates33556 Ref: -unfold33041
Ref: -any?33680 Node: Predicates33849
Ref: -all?34000 Ref: -any?33973
Ref: -none?34330 Ref: -all?34293
Ref: -only-some?34632 Ref: -none?34623
Ref: -contains?35117 Ref: -only-some?34925
Ref: -same-items?35506 Ref: -contains?35410
Ref: -is-prefix?35891 Ref: -same-items?35799
Ref: -is-suffix?36214 Ref: -is-prefix?36184
Ref: -is-infix?36537 Ref: -is-suffix?36507
Node: Partitioning36891 Ref: -is-infix?36830
Ref: -split-at37079 Node: Partitioning37184
Ref: -split-with37364 Ref: -split-at37372
Ref: -split-on37767 Ref: -split-with37657
Ref: -split-when38443 Ref: -split-on38060
Ref: -separate39083 Ref: -split-when38736
Ref: -partition39525 Ref: -separate39376
Ref: -partition-all39977 Ref: -partition39818
Ref: -partition-in-steps40405 Ref: -partition-all40270
Ref: -partition-all-in-steps40902 Ref: -partition-in-steps40698
Ref: -partition-by41387 Ref: -partition-all-in-steps41195
Ref: -partition-by-header41771 Ref: -partition-by41680
Ref: -partition-after-pred42375 Ref: -partition-by-header42062
Ref: -partition-before-pred42721 Ref: -partition-after-pred42666
Ref: -partition-before-item43074 Ref: -partition-before-pred43037
Ref: -partition-after-item43387 Ref: -partition-before-item43415
Ref: -group-by43695 Ref: -partition-after-item43726
Node: Indexing44134 Ref: -group-by44032
Ref: -elem-index44336 Node: Indexing44469
Ref: -elem-indices44731 Ref: -elem-index44671
Ref: -find-index45114 Ref: -elem-indices45066
Ref: -find-last-index45603 Ref: -find-index45449
Ref: -find-indices46107 Ref: -find-last-index45938
Ref: -grade-up46515 Ref: -find-indices46442
Ref: -grade-down46918 Ref: -grade-up46850
Node: Set operations47328 Ref: -grade-down47253
Ref: -union47511 Node: Set operations47663
Ref: -difference47954 Ref: -union47846
Ref: -intersection48374 Ref: -difference48288
Ref: -powerset48815 Ref: -intersection48705
Ref: -permutations49029 Ref: -powerset49142
Ref: -distinct49330 Ref: -permutations49355
Node: Other list operations49656 Ref: -distinct49655
Ref: -rotate49881 Node: Other list operations49979
Ref: -repeat50176 Ref: -rotate50204
Ref: -cons*50439 Ref: -repeat50574
Ref: -snoc50826 Ref: -cons*50837
Ref: -interpose51239 Ref: -snoc51224
Ref: -interleave51539 Ref: -interpose51637
Ref: -zip-with51908 Ref: -interleave51935
Ref: -zip52625 Ref: -zip-with52304
Ref: -zip-fill53431 Ref: -zip53021
Ref: -unzip53754 Ref: -zip-fill53827
Ref: -cycle54288 Ref: -unzip54150
Ref: -pad54661 Ref: -cycle54684
Ref: -table54985 Ref: -pad55057
Ref: -table-flat55775 Ref: -table55380
Ref: -first56784 Ref: -table-flat56170
Ref: -some57156 Ref: -first57179
Ref: -last57465 Ref: -some57551
Ref: -first-item57799 Ref: -last57860
Ref: -second-item58215 Ref: -first-item58194
Ref: -third-item58495 Ref: -second-item58610
Ref: -fourth-item58773 Ref: -third-item58890
Ref: -fifth-item59039 Ref: -fourth-item59168
Ref: -last-item59301 Ref: -fifth-item59434
Ref: -butlast59593 Ref: -last-item59696
Ref: -sort59840 Ref: -butlast59988
Ref: -list60328 Ref: -sort60235
Ref: -fix60659 Ref: -list60723
Node: Tree operations61199 Ref: -fix61054
Ref: -tree-seq61395 Node: Tree operations61594
Ref: -tree-map62253 Ref: -tree-seq61790
Ref: -tree-map-nodes62696 Ref: -tree-map62648
Ref: -tree-reduce63551 Ref: -tree-map-nodes63091
Ref: -tree-reduce-from64433 Ref: -tree-reduce63946
Ref: -tree-mapreduce65034 Ref: -tree-reduce-from64828
Ref: -tree-mapreduce-from65894 Ref: -tree-mapreduce65429
Ref: -clone67180 Ref: -tree-mapreduce-from66289
Node: Threading macros67508 Ref: -clone67575
Ref: ->67653 Node: Threading macros67903
Ref: ->>68145 Ref: ->68048
Ref: -->68650 Ref: ->>68540
Ref: -as->69211 Ref: -->69045
Ref: -some->69666 Ref: -as->69606
Ref: -some->>70040 Ref: -some->70061
Ref: -some-->70476 Ref: -some->>70435
Node: Binding70947 Ref: -some-->70871
Ref: -when-let71159 Node: Binding71342
Ref: -when-let*71644 Ref: -when-let71554
Ref: -if-let72172 Ref: -when-let*72039
Ref: -if-let*72567 Ref: -if-let72567
Ref: -let73184 Ref: -if-let*72962
Ref: -let*79272 Ref: -let73579
Ref: -lambda80213 Ref: -let*79667
Ref: -setq81015 Ref: -lambda80608
Node: Side-effects81831 Ref: -setq81410
Ref: -each82025 Node: Side-effects82226
Ref: -each-while82432 Ref: -each82420
Ref: -each-indexed82792 Ref: -each-while82827
Ref: -each-r83310 Ref: -each-indexed83187
Ref: -each-r-while83743 Ref: -each-r83705
Ref: -dotimes84118 Ref: -each-r-while84138
Ref: -doto84421 Ref: -dotimes84513
Node: Destructive operations84848 Ref: -doto84816
Ref: !cons85021 Ref: --doto85243
Ref: !cdr85227 Node: Destructive operations85518
Node: Function combinators85423 Ref: !cons85691
Ref: -partial85697 Ref: !cdr85897
Ref: -rpartial86092 Node: Function combinators86092
Ref: -juxt86494 Ref: -partial86366
Ref: -compose86926 Ref: -rpartial86761
Ref: -applify87484 Ref: -juxt87163
Ref: -on87915 Ref: -compose87595
Ref: -flip88441 Ref: -applify88153
Ref: -const88753 Ref: -on88600
Ref: -cut89097 Ref: -flip89126
Ref: -not89583 Ref: -const89438
Ref: -orfn89893 Ref: -cut89782
Ref: -andfn90327 Ref: -not90268
Ref: -iteratefn90822 Ref: -orfn90578
Ref: -fixfn91525 Ref: -andfn91012
Ref: -prodfn93094 Ref: -iteratefn91507
Node: Development94163 Ref: -fixfn92210
Node: Contribute94512 Ref: -prodfn93779
Node: Changes95260 Node: Development94848
Node: Contributors98259 Node: Contribute95197
Node: Index99883 Node: Changes95945
Node: Contributors98944
Node: Index100568
 
End Tag Table End Tag Table

@ -1425,7 +1425,7 @@ Return the longest common prefix of @var{lists}.
@result{} '(1) @result{} '(1)
@end group @end group
@group @group
(-common-prefix '(1 2) nil '(1 2)) (-common-prefix '(1 2) '(3 4) '(1 2))
@result{} nil @result{} nil
@end group @end group
@group @group
@ -1435,6 +1435,26 @@ Return the longest common prefix of @var{lists}.
@end example @end example
@end defun @end defun
@anchor{-common-suffix}
@defun -common-suffix (&rest lists)
Return the longest common suffix of @var{lists}.
@example
@group
(-common-suffix '(1))
@result{} '(1)
@end group
@group
(-common-suffix '(1 2) '(3 4) '(1 2))
@result{} nil
@end group
@group
(-common-suffix '(1 2 3 4) '(2 3 4) '(3 4))
@result{} '(3 4)
@end group
@end example
@end defun
@anchor{-min} @anchor{-min}
@defun -min (list) @defun -min (list)
Return the smallest value from @var{list} of numbers or markers. Return the smallest value from @var{list} of numbers or markers.
@ -2047,15 +2067,15 @@ Partition directly after each time @var{pred} is true on an element of @var{list
@example @example
@group @group
(-partition-after-pred #'oddp '()) (-partition-after-pred (function oddp) '())
@result{} '() @result{} '()
@end group @end group
@group @group
(-partition-after-pred #'oddp '(1)) (-partition-after-pred (function oddp) '(1))
@result{} '((1)) @result{} '((1))
@end group @end group
@group @group
(-partition-after-pred #'oddp '(0 1)) (-partition-after-pred (function oddp) '(0 1))
@result{} '((0 1)) @result{} '((0 1))
@end group @end group
@end example @end example
@ -2067,15 +2087,15 @@ Partition directly before each time @var{pred} is true on an element of @var{lis
@example @example
@group @group
(-partition-before-pred #'oddp '()) (-partition-before-pred (function oddp) '())
@result{} '() @result{} '()
@end group @end group
@group @group
(-partition-before-pred #'oddp '(1)) (-partition-before-pred (function oddp) '(1))
@result{} '((1)) @result{} '((1))
@end group @end group
@group @group
(-partition-before-pred #'oddp '(0 1)) (-partition-before-pred (function oddp) '(0 1))
@result{} '((0) (1)) @result{} '((0) (1))
@end group @end group
@end example @end example
@ -2450,6 +2470,10 @@ The time complexity is @var{o}(n).
(-rotate -3 '(1 2 3 4 5 6 7)) (-rotate -3 '(1 2 3 4 5 6 7))
@result{} '(4 5 6 7 1 2 3) @result{} '(4 5 6 7 1 2 3)
@end group @end group
@group
(-rotate 16 '(1 2 3 4 5 6 7))
@result{} '(6 7 1 2 3 4 5)
@end group
@end example @end example
@end defun @end defun
@ -3909,6 +3933,19 @@ the target form.
@end example @end example
@end defmac @end defmac
@anchor{--doto}
@defmac --doto (eval-initial-value &rest forms)
Anaphoric form of @code{-doto} (@pxref{-doto}).
Note: @code{it} is not required in each form.
@example
@group
(gethash "key" (--doto (make-hash-table :test 'equal) (puthash "key" "value" it)))
@result{} "value"
@end group
@end example
@end defmac
@node Destructive operations @node Destructive operations
@section Destructive operations @section Destructive operations
@ -4045,7 +4082,7 @@ expects a list with n items as arguments
@result{} '(3 6 15) @result{} '(3 6 15)
@end group @end group
@group @group
(-map (-applify (lambda (a b c) `(,a (,b (,c))))) '((1 1 1) (1 2 3) (5 5 5))) (-map (-applify (lambda (a b c) (\` ((\, a) ((\, b) ((\, c))))))) '((1 1 1) (1 2 3) (5 5 5)))
@result{} '((1 (1 (1))) (1 (2 (3))) (5 (5 (5)))) @result{} '((1 (1 (1))) (1 (2 (3))) (5 (5 (5))))
@end group @end group
@group @group

@ -98,6 +98,13 @@ Change `readme-template.md` or `examples-to-docs.el` instead.
## Changelist ## Changelist
### From 2.15 to 2.16
- Added `--doto`, anaphoric version of `-doto` (#282)
- Aliased `-cons-pair-p` to `-cons-pair?`(#288)
- Generalized `-rotate` for |n| greater than the length of the list (@leungbk, #290)
- Added a mechanism to extend destructuring with custom matchers (@yyoncho, #277)
### From 2.14 to 2.15 ### From 2.14 to 2.15
This release brings new destructuring features, some new control flow This release brings new destructuring features, some new control flow

Loading…
Cancel
Save