On Tuesday, July 15, 2014 12:38:53 PM UTC+1, Jeremy Heiler wrote: > > On Tue, Jul 15, 2014 at 3:15 AM, <edw...@kenworthy.info <javascript:>> > wrote: > >> Curiouser and curiouser. >> >> I turns out the problem was *not* with my next-to-play function but >> rather with the fact that it takes three arguments but I was only passing >> it two. >> >> The curious part is that whilst the compiler complained about the wrong >> arity if I evaluated the call directly, it didn't when it was part of a let! >> > > Are you able to reproduce this problem with a fresh environment? > >
Yes. Creating a new project in Lein then opening it in Light Table and with minimal edits: (ns test.core) (defn bar [a b c]) (defn foo "I don't do a whole lot." [a b] ((let [y (bar(a b))] (println a b "Hello, World!")))) foo evaluates without error despite calling bar with too few parameters. I suspect in my code next-to-play is messing up the stack because it pulls 3 parameters off the stack when only 2 have been placed on it. >> (let [next-player (next-to-play @current-board player)]... >> >> should be: >> >> (let [next-player (next-to-play @current-board player false)]... >> >> But the compiler doesn't complain! >> > -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.