From 58579320cda35529bdee7ef9a5ac8033aba9a3fb Mon Sep 17 00:00:00 2001 From: Csilla Nagyne Martinak Date: Sat, 17 Oct 2015 14:31:42 +0200 Subject: [PATCH] hy.core.macros: Add docstrings for -> and ->> Borrowed from the API docs and Clojure, mostly. Signed-off-by: Csilla Nagyne Martinak --- hy/core/macros.hy | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hy/core/macros.hy b/hy/core/macros.hy index 54446e9..5d52ed3 100644 --- a/hy/core/macros.hy +++ b/hy/core/macros.hy @@ -120,7 +120,10 @@ (defmacro -> [head &rest rest] - ;; TODO: fix the docstring by someone who understands this + "Threads the head through the rest of the forms. Inserts + head as the second item in the first form of rest. If + there are more forms, inserts the first form as the + second item in the second form of rest, etc." (setv ret head) (for* [node rest] (if (not (isinstance node HyExpression)) @@ -143,7 +146,10 @@ ~f)) (defmacro ->> [head &rest rest] - ;; TODO: fix the docstring by someone who understands this + "Threads the head through the rest of the forms. Inserts + head as the last item in the first form of rest. If there + are more forms, inserts the first form as the last item + in the second form of rest, etc." (setv ret head) (for* [node rest] (if (not (isinstance node HyExpression))