of course repeat works with functions:

user=> (take 4 (map #(% 4) (repeat inc)))
(5 5 5 5)
On Sun, Dec 23, 2012 at 11:56 PM, Marko Topolnik
<marko.topol...@gmail.com> wrote:
> repeat is not supposed to work with functions, but there's repeatedly.
>
>
> On Monday, December 24, 2012 4:20:23 AM UTC+1, Andrew Care wrote:
>>
>> I'm trying to use repeat with a function argument. This works:
>>
>> (reduce + (filter (fn [number] (zero? (some #{0} (map mod (take 2 (repeat
>> 9)) [3 5])))) (range 1 1000)))
>>
>> This doesn't:
>>
>> (reduce + (filter (fn [number] (zero? (some #{0} (map mod (take 2 (repeat
>> number)) [3 5])))) (range 1 1000)))
>>
>> Why can I use (repeat 9) and not (repeat number)?
>
> --
> 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



-- 
Ben Wolfson
"Human kind has used its intelligence to vary the flavour of drinks,
which may be sweet, aromatic, fermented or spirit-based. ... Family
and social life also offer numerous other occasions to consume drinks
for pleasure." [Larousse, "Drink" entry]

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

Reply via email to