You can go two steps further:

    l.sum

It relies on implicits/typeclasses though - so some people might criticise
this sample for being overly complex.



On 1 March 2014 02:03, Reinier Zwitserloot <reini...@gmail.com> wrote:

>
>
> On Friday, 28 February 2014 18:50:50 UTC+1, Cédric Beust ♔ wrote:
>>
>> You can go one step further:
>>
>> scala> l.fold(0)(_ + _)
>> res0: Int = 6
>>
>>
> RIght. I forgot about the scala 'arse' operator. My mistake.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Java 
Posse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to javaposse+unsubscr...@googlegroups.com.
To post to this group, send email to javaposse@googlegroups.com.
Visit this group at http://groups.google.com/group/javaposse.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to