Not a bug imho, you're invoking reduce with no init arg so you're
forcing the realization of at least two elements in the coll, one for
init and one for step -- the step one causes the exception.

Ambrose Bonnaire-Sergeant writes:

> Here's some weird behaviour I found from 1.6.
>
> user=> (take 1 (iterate zero? true))
> (true)
> user=> (reduce (fn [l _] (reduced l)) (iterate zero? true))
> ClassCastException java.lang.Boolean cannot be cast to java.lang.Number
>  clojure.lang.Numbers.isZero (Numbers.java:90)
>
> Is this a bug, and should this be fixed?
>
> Thanks,
> Ambrose
>
> On Wed, Apr 1, 2015 at 10:28 PM, Alex Miller <[email protected]> wrote:
>
>> Thanks! If anyone wants to throw a patch, would love to have one. Must
>> include test ...
>>
>> On Wednesday, April 1, 2015 at 8:14:52 PM UTC-5, Ambrose Bonnaire-Sergeant
>> wrote:
>>>
>>> http://dev.clojure.org/jira/browse/CLJ-1692
>>>
>>> On Wed, Apr 1, 2015 at 9:12 PM, Ambrose Bonnaire-Sergeant <
>>> [email protected]> wrote:
>>>
>>>> Ok.
>>>>
>>>> On Wed, Apr 1, 2015 at 9:10 PM, Alex Miller <[email protected]>
>>>> wrote:
>>>>
>>>>> I would love a jira for the iterate thIng.
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Clojure" group.
>>>>> To post to this group, send email to [email protected]
>>>>> Note that posts from new members are moderated - please be patient with
>>>>> your first post.
>>>>> To unsubscribe from this group, send email to
>>>>> [email protected]
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/clojure?hl=en
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Clojure" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to [email protected]
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>

--

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to