Here's one popular form: (defn foo ([a b c] (foo a b c nil)) ([a b c d] (if d ...)))
Most multi-arity functions have the same behavior for every arity, with some default argument values. -S On Sep 27, 2:13 pm, Glen Rubin <rubing...@gmail.com> wrote: > I have a function that will accept 3 or 4 parameters. Another > function I have calls it and passes in 4 arguments. Sometimes, the > 4th argument is nil and this causes an error, instead of just calling > the main function as if I passed in 3 arguments. Meaning the main > function sees a 4th parameter with nil value. How do I get it to act > as only 3 parameters were passed in this circumstance? thx -- 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