Alias `-zip-pair`, prepare for breaking change

See issue #135
master
Magnar Sveen 11 years ago
parent 71668fe6ac
commit a3cd1ac209
  1. 12
      README.md
  2. 7
      dash.el
  3. 7
      readme-template.md

@ -25,6 +25,13 @@ To get function combinators:
;; Package-Requires: ((dash "2.12.0") (dash-functional "1.2.0") (emacs "24"))
## Upcoming breaking change!
- For backward compatibility reasons `-zip` return a cons-cell instead of a list
with two elements when called on two lists. This is a clunky API, and in an
upcoming 2.0 release of Dash it will always return a list. If you rely on the
cons-cell return value, use `-zip-pair` instead.
## Syntax highlighting of dash functions
Font lock of dash functions in emacs lisp buffers is now optional.
@ -1434,7 +1441,10 @@ 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.
of cons cells. Otherwise, return the groupings as a list of lists.
Please note! This distinction is being removed in an upcoming 2.0
release of Dash. If you rely on this behavior, use -zip-pair instead.
```el
(-zip '(1 2 3) '(4 5 6)) ;; => '((1 . 4) (2 . 5) (3 . 6))

@ -1009,7 +1009,10 @@ 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. "
of cons cells. Otherwise, return the groupings as a list of lists.
Please note! This distinction is being removed in an upcoming 2.0
release of Dash. If you rely on this behavior, use -zip-pair instead."
(let (results)
(while (-none? 'null lists)
(setq results (cons (mapcar 'car lists) results))
@ -1021,6 +1024,8 @@ of cons cells. Otherwise, return the groupings as a list of lists. "
(--map (cons (car it) (cadr it)) results)
results)))
(defalias '-zip-pair '-zip)
(defun -zip-fill (fill-value &rest lists)
"Zip LISTS, with FILL-VALUE padded onto the shorter lists. The
lengths of the returned groupings are equal to the length of the

@ -25,6 +25,13 @@ To get function combinators:
;; Package-Requires: ((dash "2.12.0") (dash-functional "1.2.0") (emacs "24"))
## Upcoming breaking change!
- For backward compatibility reasons `-zip` return a cons-cell instead of a list
with two elements when called on two lists. This is a clunky API, and in an
upcoming 2.0 release of Dash it will always return a list. If you rely on the
cons-cell return value, use `-zip-pair` instead.
## Syntax highlighting of dash functions
Font lock of dash functions in emacs lisp buffers is now optional.

Loading…
Cancel
Save