Re: what's the typical usage of fn constantly

2009-01-26 Thread e
you didn't beat it to death. I learned something. I also got confused. You identity implementation makes perfect sense. But even with your explanation, I'm still lost as to how the contrib one works. Lucky for me you brought this up so I can challenge myself to try to understand what's going on

Re: what's the typical usage of fn constantly

2009-01-25 Thread wubbie
thanks for the insight! On Jan 25, 7:06 pm, "rzeze...@gmail.com" wrote: > Following James's description, I would image constantly's > implementation to look something like the following. > > (defn constantly [value] #(identity value)) > > If you haven't seen the # macro before, the form below is

Re: what's the typical usage of fn constantly

2009-01-25 Thread rzeze...@gmail.com
Following James's description, I would image constantly's implementation to look something like the following. (defn constantly [value] #(identity value)) If you haven't seen the # macro before, the form below is equivalent. (defn constantly [value] (fn [] (identity value))) Making use of Chri

Re: what's the typical usage of fn constantly

2009-01-25 Thread wubbie
thanks James, I'll have a look. -sun On Jan 25, 2:00 pm, James Reeves wrote: > On Jan 25, 5:34 pm, wubbie wrote: > > > What's the typical usage of fn constantly ? > > When you need a function that constantly returns the same result :) > > That probably doesn't tell you any more than you know

Re: what's the typical usage of fn constantly

2009-01-25 Thread James Reeves
On Jan 25, 5:34 pm, wubbie wrote: > What's the typical usage of fn constantly ? When you need a function that constantly returns the same result :) That probably doesn't tell you any more than you know already, so I'll give you a real world use. My rnd-utils library has a function generating ra