>
> The code behind partition:
> http://lampsvn.epfl.ch/trac/scala/browser/scala/tags/R_2_8_0_final/src//library/scala/collection/TraversableLike.scala#L311
>
> def partition(p: A => Boolean): (Repr, Repr) = {
>   val l, r = newBuilder
>   for (x <- this) (if (p(x)) l else r) += x
>   (l.result, r.result)
> }
>

Well, this brings a new twist into it, isn't it ? Clearly this code is
shorted than Java - no arguing here, but one could definitely argue that it
is more complex than the rather plain Java code we saw on the example...

IMO, I think the question behind is more about culture. If you show the Java
example to a C programmer from the 80's he would probably find it difficult
to read and understand - as it is right now for people not well versed in
Scala to break down this piece of code...

-- 
Romain PELISSE,
"The trouble with having an open mind, of course, is that people will insist
on coming along and trying to put things in it" -- Terry Pratchett
http://belaran.eu/

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to