Clarify as-> docstring

This commit is contained in:
Matthew Egan Odendahl 2016-06-19 21:14:16 -06:00 committed by GitHub
parent 7e13bb4e5f
commit e0ecaca315

View File

@ -31,10 +31,11 @@
[hy._compat [PY33 PY34]]) [hy._compat [PY33 PY34]])
(defmacro as-> [head name &rest rest] (defmacro as-> [head name &rest rest]
"Becomes ordered assignments to the provided name. The previous result "Expands to sequence of assignments to the provided name, starting with head.
is thus available in each form. Returns the final result, and leaves the name The previous result is thus available in the subsequent form. Returns the
bound to it in the local scope. This behaves like the threading macros, but final result, and leaves the name bound to it in the local scope. This behaves
requires you to specify the threading point per form via the name." much like the other threading macros, but requires you to specify the threading
point per form via the name instead of always the first or last arument."
`(do (setv `(do (setv
~name ~head ~name ~head
~@(interleave (repeat name) rest)) ~@(interleave (repeat name) rest))