On Wed, May 2, 2012 at 4:24 PM, Jim - FooBar(); <jimpil1...@gmail.com>wrote:
> Hey everyone, > > I've been trying all morning (more than 3 hours) to improve my macro but > with little success...basically what I had before i started fiddling with > it was a macro which would take an expression of the form (1 + 4 * 5 - 1 / > 2) and would return the expression in prefix form: (/ (- (* (+ 1 4) 5) 1) > 2)...it would not handle nested parens and no operator precedence...This is > it: > ------------------------------**------------------------------** > ------------------------------**------------------------------** > --------------- > (defmacro functionize [macro] > `(fn [& args#] (eval (cons '~macro args#)))) > > (defmacro infix-to-prefix [expr] > (if-not (empty? (filter #(list? %)) '~expr)) > This looks suspicious. filter is being called with 1st parameter anon function, and no second parameter. How does that compile? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en