From 7aaece3725c675ee1d359ce9b44d2e391bb19f93 Mon Sep 17 00:00:00 2001 From: Kodi Arfer Date: Sat, 3 Aug 2019 09:26:32 -0400 Subject: [PATCH] Use #* assignments instead of `head-tail` --- hy/contrib/multi.hy | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hy/contrib/multi.hy b/hy/contrib/multi.hy index 08016e2..c84adf9 100644 --- a/hy/contrib/multi.hy +++ b/hy/contrib/multi.hy @@ -70,9 +70,6 @@ (with-decorator (method-decorator ~name) (defn ~name ~params ~@body)))) -(defn head-tail [l] - (, (get l 0) (cut l 1))) - (defmacro defn [name &rest bodies] (setv arity-overloaded? (fn [bodies] (if (isinstance (first bodies) HyString) @@ -83,10 +80,10 @@ (do (setv comment (HyString)) (if (= (type (first bodies)) HyString) - (setv [comment bodies] (head-tail bodies))) + (setv [comment #* bodies] bodies)) (+ '(do (import [hy.contrib.multi [MultiDispatch]])) (lfor [let-binds #* body] bodies `(with-decorator MultiDispatch (defn ~name ~let-binds ~comment ~@body))))) (do - (setv [lambda-list body] (head-tail bodies)) + (setv [lambda-list #* body] bodies) `(setv ~name (fn* ~lambda-list ~@body)))))