Re: Matching map in ArraySeq
Hi, (defn example [& args] (let [[opts args] (let [opts? (first args)] (if (map? opts?) [opts? (next args)] [nil args]))] (reduce str args))) Kind regards Meikel -- You received this message because you are subscribed
Re: Matching map in ArraySeq
> My question is: I would like to allow the first parameter to be an > (optional) map containing key values for the function. What's a clean, > readable way to do that? How about this: (defn example [& args] (let [opts (when map? (first args)) args (when opts (next args))] (redu