Closed emnh closed 8 years ago
So I think your issue can be distilled down into:
(defn f []
(infix 3 + 7))
(macroexpand-1 '(infix f() + 10))
; => (+ (f nil) 10)
And obviously trying to call (f nil)
fails and gives you the arity warning in your clojurescript.
The offending line of code that generates this is (I think) https://github.com/rm-hull/infix/blob/master/src/infix/core.clj#L124-L126 - it always expects there to be at least one argument.
I do remember thinking this over previously: "why would you have a function with no-args?" - I guess possible answers are:
(rand)
I think a fix would be fairly straightforward - watch this space.
Hi, there's a snapshot version on clojars (https://clojars.org/rm-hull/infix/versions/0.2.7-SNAPSHOT) with this fix in, if you could test it out and let me know if it works for you. I added some specific tests, so pretty confident it all works in clojure, but if you could check it out in clojurescript that would be great... after that I'll do a proper (non-snapshot) release.
Yup that works! Great! Thanks!
great stuff. 0.2.7 released
The following fails: