Re: multiple parameters passed to fns

2010-09-02 Thread Glen Rubin
good suggestions guys!! thx so much On Sep 2, 10:44 am, Justin Kramer wrote: > A couple other things: > 1) (apply identity ...) is the same as (first ...) > 2) Consider using the ->> macro to clean up the let > > Here's a quick rewrite: > > (defn make-target >   ([file channel sweepidx] >      (

Re: multiple parameters passed to fns

2010-09-02 Thread Mike Meyer
On Thu, 2 Sep 2010 05:54:26 -0700 (PDT) Glen Rubin wrote: > I defined a fn whose execution depends on the number of parameters > passed to it. It works fine! I am just concerned that I am doing > this in a way that is not as concise as it could or should be. Here > is my fn: > > (defn make-ta

Re: multiple parameters passed to fns

2010-09-02 Thread Justin Kramer
A couple other things: 1) (apply identity ...) is the same as (first ...) 2) Consider using the ->> macro to clean up the let Here's a quick rewrite: (defn make-target ([file channel sweepidx] (make-target file channel sweepidx 0)) ([file channel sweepidx startidx] (make-target file

Re: multiple parameters passed to fns

2010-09-02 Thread Miki
Hello Glen, I'd use the first two forms to set startidx and size and then call the "full" form: (def inf java.lang.Double/POSITIVE_INFINITY) (defn make-target "Parses text file for single sweep specified by sweepidx. If size is not specified will parse till end of sweep. If startidx and si

multiple parameters passed to fns

2010-09-02 Thread Glen Rubin
I defined a fn whose execution depends on the number of parameters passed to it. It works fine! I am just concerned that I am doing this in a way that is not as concise as it could or should be. Here is my fn: (defn make-target "Parses text file for single sweep specified by sweepidx. If size