* dash.el (-remove-item): Define as an alias of remove for speed.
* dev/examples.el (-remove-item): Extend tests.
* README.md:
* dash.texi: Regenerate docs.
* dev/examples-to-docs.el (example-to-string): Simplify.
* dev/examples-to-info.el (example-to-string): Use @error{} instead
of @result{} for errors. Use error-message-string to translate
error lists to their corresponding message.
* dev/examples-to-tests.el (example-to-should): Add support for
checking whole error lists, not just error symbols.
* dev/examples.el (-running-sum, -running-product, -iota): Specify
whole error list, not just error symbol.
* dash.texi: Regenerate.
* dash.el (---partition-all-in-steps-reversed): Rename from this...
(dash--partition-all-in-steps-reversed): ...to this. All callers
changed. Signal wrong-type-argument message conforming to
(info "(elisp) Signaling Errors"). Prefer built-in definitions over
Dash ones where either will do.
(-setq): Signal wrong-number-of-arguments like setq.
(-running-sum, -running-product): Signal wrong-type-argument.
* dev/examples.el (-running-sum, -running-product)
(-partition-in-steps, -partition-all-in-steps, -setq): Update
accordingly.
* README.md:
* dash.texi: Regenerate docs.
This reverts some of the copying added in PR #354 so as to maintain
some support for circular and dotted list tails, which can't be
copied. For more discussion, see also issue #225.
* dash.el (--take-while, -take-while, -take, -take-last)
(-drop-last): Improve docstring.
(--drop-while, -drop): Revert to not returning a copy.
(-drop-while): Update docstring accordingly.
(-split-at): Simplify. Improve docstring.
(-rotate): Prefer nthcdr over -drop for clarity.
* dev/examples.el (-drop, -drop-while): Update tests for reverted
behavior.
(-take-while, -split-at, -rotate, -cycle, -fix): Improve tests.
* README.md:
* dash.texi: Regenerate docs.
* dash.el (-cons*): Return nil when called with no arguments instead
of signaling an error. Rewrite for speed.
* dev/examples.el (-cons*): Add more tests.
* README.md:
* dash.texi: Regenerate docs.
* dash.el (-list): Fix doc in the case that the first argument is
already a list.
* dev/examples.el (-list): Expand tests.
* README.md:
* dash.texi: Regenerate docs.
Fixes#225.
* dash.el (--each, --each-while, --each-r, --each-r-while): Protect
it and it-index from modification and unused lexical variable
warnings.
(-each): Use mapc for speed.
(-each-indexed, -each-while, -each-r, -each-r-while, --dotimes)
(-dotimes, -map): Improve docstrings and make them more consistent.
(--map): Rewrite as a loop to avoid funcall overhead and unused
lexical variable warnings.
* dev/examples.el (three-letters): Remove function.
(Maps): Fix grammar.
(Unfolding): Wrap description over multiple lines.
(Side effects): No need to hyphenate side effects.
(-map, -each, --each-while, -each-indexed, -each-r, -each-r-while)
(-dotimes): Simplify and extend tests.
* README.md:
* dash.texi: Regenerate docs.
The macro was broken until now for anything other than list forms,
due to a mistake in quoting. Use this as an opportunity to rethink
the macro's behavior in this case. Instead of using funcall, which
is unusual for a macro, thread the value using ->. Suggested by
Zach Shaftel <zshaftel@gmail.com>.
* dash.el (-doto): Rewrite in terms of ->. Fix docstring. Add
Edebug spec.
(--doto): Rename argument for consistency with -doto. Expand
docstring. Add Edebug spec.
* dev/examples.el (-doto): Test fixed behavior of -doto.
* README.md:
* dash.texi: Regenerate docs.
Fixes#333.
* dash.el (--iterate): Implement in terms of dotimes. Move
definition before first use.
(-iterate): Implement in terms of --iterate.
* dev/examples.el (Unfolding): Fix group description.
(-iterate): Add more tests.
* README.md:
* dash.texi: Regenerate docs.
* Makefile: New file subsuming create-docs.sh and run-tests.sh.
* create-docs.sh:
* run-tests.sh: Remove files.
* .github/workflows/test.yml:
* dash-template.texi (Contribute):
* readme-template.md (Contribute):
* pre-commit.sh: Refer to new Make targets.
* dev/examples.el: Add support for running byte-compiled tests in
Emacs < 24.3, where setf was still defined in cl-macs.el.
* README.md:
* dash.texi: Regenerate docs.
* dash.el (-cycle): Use append for faster list copying that
continues to work with non-list sequences. Fix docstring.
* dev/examples.el (-cycle): Test that returned list is a copy.
* README.md:
* dash.info:
* dash.texi: Regenerate docs.
Emacs 27 officially deprecates cl.el, which causes run-tests.sh to
fail even when all tests pass, due to byte-compiler warnings.
* dash.el: Do not unconditionally require cl.el in all Emacs
versions. Remove gv setter for -first-item, which is redundant
since -first-item is an alias of car. Also wrap calls to
gv-define-setter in with-no-warnings to suppress warnings about
gv--defsetter being undefined at runtime in certain Emacs versions.
(-third-item): Do not assume caddr is defined just because cl.el was
loaded within eval-when-compile: caddr is only defined if cl.el is
loaded at runtime, or in Emacs 26 and above.
* dev/examples.el (odd?): New helper function akin to even?.
(-partition-after-pred, -partition-before-pred): Use it instead of
assuming oddp from cl.el is defined.
* run-tests.sh: Byte-compile all Emacs versions. Pass -Q along with
-batch for some older Emacs versions. Consistently use
short (single-hyphen) Emacs options.
* README.md:
* dash.info:
* dash.texi: Regenerate docs.
The descructoring could be extended by defining a function named
`dash-expand:&{destructoring-key}` where {destructoring-key} stands for the key
that will be used in the let destructoring, e. g. &hash/&plist in the standart
dash