diff --git a/hy/contrib/multi.hy b/hy/contrib/multi.hy index 1a19fc9..08016e2 100644 --- a/hy/contrib/multi.hy +++ b/hy/contrib/multi.hy @@ -84,13 +84,9 @@ (setv comment (HyString)) (if (= (type (first bodies)) HyString) (setv [comment bodies] (head-tail bodies))) - (setv ret `(do)) - (.append ret '(import [hy.contrib.multi [MultiDispatch]])) - (for [body bodies] - (setv [let-binds body] (head-tail body)) - (.append ret - `(with-decorator MultiDispatch (defn ~name ~let-binds ~comment ~@body)))) - ret) + (+ '(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 ~name (fn* ~lambda-list ~@body))))) diff --git a/hy/contrib/walk.hy b/hy/contrib/walk.hy index d30f29e..40f0c62 100644 --- a/hy/contrib/walk.hy +++ b/hy/contrib/walk.hy @@ -89,7 +89,7 @@ splits a fn argument list into sections based on &-headers. returns an OrderedDict mapping headers to sublists. Arguments without a header are under None. " - (setv headers '[&optional &rest &kwonly &kwargs] + (setv headers ['&optional '&rest '&kwonly '&kwargs] sections (OrderedDict [(, None [])]) header None) (for [arg form] @@ -169,7 +169,7 @@ Arguments without a header are under None. #{}))))) (defn handle-args-list [self] (setv protected #{} - argslist `[]) + argslist []) (for [[header section] (-> self (.tail) first lambda-list .items)] (if header (.append argslist header)) (cond [(in header [None '&rest '&kwargs])