Copyright (C) 2012-2024 Free Software Foundation, Inc.
See the end of the file for license conditions.
- Calling
-zip
with two arguments now emits a warning. This long-discouraged calling convention remains supported, but the caller is now referred to the equivalent-zip-pair
instead (Stefan Monnier, #400). - Calling
-zip-pair
with less than or more than two arguments is now deprecated, and can be replaced with the equivalent call to-zip-lists
instead.
-
Fixed a regression from
2.18
in-take
that caused it to prematurely signal an error on improper lists (#393). -
The function
-pad
can now be called with zero lists as arguments. -
The functions
-union
,-intersection
, and-difference
now return proper sets, without duplicate elements (#397). -
The functions
-same-items?
and-permutations
now work on multisets (lists with duplicate elements) (#390, #397, #399).For example:
(-same-items? '(1 1 2 3) '(3 1 2)) ; => t (-permutations '(1 1 2)) ; => '((1 1 2) (1 2 1) (2 1 1))
-
Several functions which are documented as returning a fresh, mutable object (such as a copy of one of their arguments) are no longer marked as
pure
. Pure functions called with constant arguments are evaluated during byte-compilation; the resulting value is an immutable constant, and thus unsafe to modify destructively. The functions in question are:-clone
,-cons*
,-drop-last
,-interleave
,-interpose
,-iota
,-non-nil
,-repeat
,-slice
,-snoc
,-split-at
,-take
,-take-last
.
- The function
-contains?
now returns the matching tail of the list instead of justt
, similarly tomember
(#397). - New function
-frequencies
that takes a list and counts how many times each distinct element occurs in it (suggested by @ebpa, #209, #214, #399). - New functions
-zip-lists-fill
and-unzip-lists
which are better behaved versions of-zip-fill
and-unzip
, respectively (#400).
- Fixed a regression from
2.18
in-is-suffix-p
which led to false negatives when parts of the suffix appeared multiple times in the list being searched (Bennett Rennier, #384).
- Reverted a breaking change introduced in
2.18.0
that caused the threading macro-->
to be indented differently from->
and->>
(#375). - Added and fixed Edebug specifications for many Dash macros (Philipp Stephani, #380, #381).
- The combinators
-on
,-flip
,-not
,-andfn
, and-orfn
now return variadic functions that take any number of arguments (#308). - New combinator
-rotate-args
similar to-flip
, but for arbitrary arglist rotations (suggested by @vapniks, #72). - New function
-every
and its anaphoric macro counterpart--every
. They are like the existing-every-p
and--every-p
, respectively, but return the last non-nil
result instead of justt
. - New macro
--partition-after-pred
which affords-partition-after-pred
better performance (Per Weijnitz, #362).
- Fixed a regression from
2.17
as well as a long-standing bug in--iterate
, which evaluated its arguments one too many times. This in turn could lead to errors in-flatten-n
when it tried flattening certain structures too far (#373).
This release absorbs the now obsolete dash-functional
version
1.3.0
into dash
, and brings the very old version of dash
on GNU
ELPA up to date.
Package maintainers should replace all uses of dash-functional
,
which will eventually be deleted, with dash
version 2.18.0
. For
more information on this, see:
https://github.com/magnars/dash.el/wiki/Obsoletion-of-dash-functional.el
-
New function
-iota
for generating arithmetic sequences (@holomorph, #215). -
Calling
-list
with more than one argument is now deprecated. -
-lambda
now accepts an empty argument list. -
New anaphoric macros
--reductions-from
,--reductions
,--reductions-r-from
, and--reductions-r
corresponding to the analogous non-anaphoric functions. -
-doto
threading now works as with->
. -
New buffer-local minor mode
dash-fontify-mode
and globalized counterpartglobal-dash-fontify-mode
for fontifying special Dash variables such asit
,it-index
,acc
, etc. The minor mode also fontifies calls to Dash macros in older Emacs versions which did not dynamically detect macro calls.This obsoletes the user option
dash-enable-fontlock
and the functiondash-enable-font-lock
, which is now an alias ofglobal-dash-fontify-mode
. -
New command
dash-register-info-lookup
for integration withC-h S
(info-lookup-symbol
). This command allows Dash symbols to be looked up in the Dash manual just like Elisp symbols are looked up in the Elisp manual. The command can be called directly when needed, or automatically from youruser-init-file
. For example:(with-eval-after-load 'info-look (dash-register-info-lookup))
-
Dash is now listed under the standard Customization groups and Finder keywords
extensions
andlisp
. -
The Dash manual is now licensed under the GNU Free Documentation License version 1.3.
-
Various other bug fix, performance, byte-compilation, and documentation improvements.
- Sped up
-uniq
by using hash-tables when possible (@cireu, #305). - Fixed
-inits
to be non-destructive (@SwiftLawnGnome, #313). - Fixed indent rules for
-some->
and family (@wbolster, #321). - Added
-zip-lists
which always returns a list of proper lists, even for two input lists, in contrast to-zip
(see issue #135).
- 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).
This release brings new destructuring features, some new control flow functions and performance optimizations.
- Added
-setq
with destructuring binding support similar to the-let
family (#116). - Added smarter key destructuring in
-let
and friends where variables are auto-derived from keys (#111). - Allowed
-let
bindings without a source value form (#256). - Added
-each-r
and-each-r-while
(@doublep, #159). - Added
-common-suffix
(@basil-conto, #263). - Improved performance of folds (
-reduce
and friends) (@basil-conto, #264).
This release retired Emacs 23 support.
- Added Edebug support for threading macros (@Wilfred).
- Added
-unzip
. - Added support for
-first-item
and-last-item
as place forms. - Added
-powerset
and-permutations
(@holomorph). - Added
-as->
for threading a named variable (@zck). - Added
-partition-after-pred
,-partition-before-pred
,-partition-after-item
, and-partition-before-item
(@zck). - Fixed a bug in
-any-p
and friends testing fornull
on lists containingnil
(#239). - Fixed infinite loop bug in
-zip
and-interleave
when called with empty input. - Added
-second-item
through-fifth-item
as alternatives tonth
(@Wilfred). - Added
-tails
and-inits
. - Added
-running-sum
and-running-product
. - Added the
-reductions[-r][-from]
family of functions (like-reduce
but collecting intermediate results). - Added
-common-prefix
(@basil-conto).
-let
now supports&alist
destructuring.- Various performance improvements.
-zip
might change in a future release to always return a list of proper lists. Added-zip-pair
for users who explicitly want the old behavior.- Enabled lexical binding in
dash.el
for Emacs versions 24 or newer (#130). - Added
-select-column
and-select-columns
. - Fixed
-map-last
and--remove-last
to be non-destructive (#158). - Added
-each-indexed
and--each-indexed
. - Added
-take-last
and-drop-last
. - Added the
-doto
macro. -cut <>
is now treated as a function, consistent with SRFI 26 (#185).
- Added GNU ELPA support (Phillip Lord).
- Added
-some->
,-some->>
, and-some-->
macros (Cam Saul). -is-suffix?
is now non-destructive.- Faster hash table implementation for
-union
. - Improvements to docstrings and examples.
- Lots of clean up w.r.t. byte compilation, debug macros, and tests.
- Added
-let
destructuring to-if-let
and-when-let
(Fredrik Bergroth).
- Added
-let
,-let*
, and-lambda
with destructuring. - Added
-tree-seq
and-tree-map-nodes
. - Added
-non-nil
. - Added
-fix
. - Added
-fixfn
(dash-functional
version1.2
). - Added
-copy
(Wilfred Hughes).
- Added
-butlast
.
-zip
now supports more than two lists (Steve Lamb).- Added
-cycle
,-pad
,-annotate
, and-zip-fill
(Steve Lamb). - Added
-table
,-table-flat
(finite Cartesian product). - Added
-flatten-n
. -slice
now supports a "step" argument.- Added functional combinators
-iteratefn
and-prodfn
. - Added
-replace
,-splice
, and-splice-list
which generalize-replace-at
and-insert-at
. - Added
-compose
,-iteratefn
, and-prodfn
(dash-functional
version1.1
).
- Added
-is-prefix-p
,-is-suffix-p
, and-is-infix-p
(Matus Goljer). - Added
-iterate
and-unfold
(Matus Goljer). - Added
-split-on
and-split-when
(Matus Goljer). - Added
-find-last-index
(Matus Goljer). - Added
-list
(Johan Andersson).
- Added
-same-items?
(Johan Andersson). - Various bugfixes.
- Added
-snoc
(Matus Goljer). - Added
-replace-at
,-update-at
,-remove-at
, and-remove-at-indices
(Matus Goljer).
- Added tree operations (Matus Goljer).
- Made Font Lock optional.
- Added
-compose
(Christina Whyte).
- Added indexing operations (Matus Goljer).
- Split out
dash-functional.el
(Matus Goljer). - Added
-andfn
,-orfn
,-not
,-cut
,-const
,-flip
, and-on
(Matus Goljer). - Fixed
-min
,-max
,-min-by
, and-max-by
(Matus Goljer).
- Added
-first-item
and-last-item
(Wilfred Hughes).
- Added
-rotate
(Matus Goljer).
- Added
-min
,-max
,-min-by
, and-max-by
(Johan Andersson).
- Added
-sum
and-product
(Johan Andersson).
- Added
-sort
. - Added
-reduce-r
(Matus Goljer). - Added
-reduce-r-from
(Matus Goljer).
- Added
-partition-in-steps
. - Added
-partition-all-in-steps
.
- Added
-last
(Matus Goljer). - Added
-insert-at
(Emanuel Evans). - Added
-when-let
and-if-let
(Emanuel Evans). - Added
-when-let*
and-if-let*
(Emanuel Evans). - Various bugfixes.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.