Re: exception thrown when passing in nil parameter

2010-09-28 Thread Glen Rubin
yeah, that's what i was thinking of doing, but it didn't seem pretty. thanks! On Sep 27, 5:30 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote: 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

exception thrown when passing in nil parameter

2010-09-27 Thread Glen Rubin
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

Re: exception thrown when passing in nil parameter

2010-09-27 Thread Alan
(defn f ([a b c] ...) ([a b c d] (if d ... (f a b c Not the prettiest solution, I'll grant you; I'm sure someone will come along with something better. But this will work. On Sep 27, 11:13 am, Glen Rubin rubing...@gmail.com wrote: I have a function that will accept 3

Re: exception thrown when passing in nil parameter

2010-09-27 Thread Stuart Sierra
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