I hit my head against the wall for the past 30 minutes, trying to figure out why this simple code is not working. All he does is check to see if at least one command line argument is specified.
(defn check_args [] (if (first *command-line-args*) println "value is not nil" println "value is nil")) (check_args)
When I run the code, I get a runtime exception that states:
java.lang.RuntimeException: Too many arguments to if
I am sure this is something simple, but for my life I canβt understand where the problem is. The code pulling the first element from the sequence returns the first element in the sequence, or nil if it does not exist, so it seems pretty simple.
source share