The ->, ->>, and --> threading macros have short names, and they align
all arguments vertically, including the first one.
While the -some->, -some->>, and -some--> macros have similar
behaviour, they actually have quite long names, resulting in code that
looks like this:
(-some->> '(1 2 3)
(do-something)
(and-something-else))
Adding a (declare (indent 1)) declaration for those variants
results in this indentation instead:
(-some->> '(1 2 3)
(do-something)
(and-something-else))
This is arguably better since the ‘some’ version of these threading
macros actually treat their first argument a bit special: if the
expression evalutes to nil, the rest won't even run, and this
indentation makes the whole expression look more like a conditional
form.
Fixes#319.
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