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
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
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
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
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