>!
and <!
are not really functions that get called (see here and here). The go
macro identifies these two symbols and auto-magically generates code according to the semantics of those two operators. So this macro has no way of knowing that a function uses the >!
or <!
operator internally, since all it gets is the forms that calls that function.
Method 1 is actually throwing an exception on each call to doit
since the actual code for >!
and <!
is just an assertion that always fails. Evaluating the code for this method in a REPLy session started with lein repl
shows the exception Exception in thread "async-dispatch-46" java.lang.AssertionError: Assert failed: >! used not in (go ...) block
a bunch of times (10 to be exact). If you are using a REPL through an nREPL client you might not be seeing this because the exception is thrown asynchronously in the server and the client is not taking this into account.
Additionally instead of using (print "something\n")
you could just use (println "something")
, not really related to your question but thought I mentioned this.