* Add -doto macro (like Clojure's doto)
Here is its documentation in clojuredocs:
(doto x & forms)
Evaluates x then calls all of the methods and functions with the
value of x supplied at the front of the given arguments. The forms
are evaluated in order. Returns x.
(doto (new java.util.HashMap) (.put "a" 1) (.put "b" 2))
Documentation:
https://clojuredocs.org/clojure.core/doto
Source (clojure):
https://github.com/clojure/clojure/blob/clojure-1.7.0/src/clj/clojure/core.clj#L3700
* Use make-symbol instead of gensym to stay consistent
Consistent with other code in dash.el
* Fix referring to rest from cl.el in -doto
* Add doto example with setcar and setcdr
* Clarify -doto docstring: eval-initial-value evalled only once
Also mention all arguments in the docstring to please checkdoc
* Make -doto documentation more in line with Emacs standards
This adds `-each-indexed` and an anaphoric variant `--each-indexed`,
equivalent to `-map-indexed`.
Whilst `--each` already defines `it-index`, it's not documented. Having
a separate version is more explicit and more discoverable because it's
similarly named to `-map-indexed`.
Fixes#175.
* .gitignore: Add files generated by "make" in elpa.git.
* dash.el (--map-first, --map-last): Silence compile warning when
`rep' does not make use of `it'.
(---partition-all-in-steps-reversed): Remove unused var `len'.
(dash--table-carry): Fix docstring and use DeMorgan.
(-find-indices): Remove unused var `i'.
(-compare-fn): Move before first use.
* dev/examples-to-tests.el:
* dev/examples-to-info.el:
* dev/examples-to-docs.el:
* dev/examples.el: Add copyright boilerplate.
This change addreses issue #123. The two new optional parameters to
`-fixfn' allow the caller to specify a custom equality test function,
such as an approximate comparison of floats, and a halt test function,
which can trigger a halt to the fixpoint iteration if it fails to
converge.
The default equality test remains `equal'. The default halt test is a
simple counter up to `-fixfn-max-iterations'. The counter is provided by
the new function `-counter'.
The revised tests illustrate the usage of the new parameters.
defexample entries may now include a symbol `~>' instead of `=>' which
uses an approximate comparison instead of `equal' to compare actual and
expected floating-point values.
Also, for completeness, add support for the `should-error' symbol `!!>' in
`examples-to-docs.el'. This is formatted as the comment ";; Error"
This is a port of the CL function `some` and the Scheme function `any`
from SRFI-1. It is thought as addition to `-any?` (which returns a
boolean) and `-first` (which returns an element). Unlike these it
returns the first truthy value of applying the predicate on each list
item.
Resolves#122.