<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user">
    <title>gmane.comp.lang.scala.user</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53424"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53423"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53422"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53421"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53420"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53419"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53418"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53417"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53416"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53415"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53414"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53413"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53412"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53411"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53410"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53409"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53408"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53407"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53406"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.user/53405"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53424">
    <title>Convert List[String] to List[Char]</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53424</link>
    <description>&lt;pre&gt;This is from Listing 3-5 (p.66) in the "Begining Scala" book.
How do I convert a List[String] to a List[Char]  ?
(I've tried several alternatives, and none worked.)

tom&amp;lt; at &amp;gt;xps ~/t/c03 $ cat rn
def roman(in: List[Char]): Int = in match {
  case 'I' :: 'V' :: rest =&amp;gt; 4 + roman(rest)
  case 'I' :: 'X' :: rest =&amp;gt; 9 + roman(rest)
  case 'I' :: rest =&amp;gt; 1 + roman(rest)
  case 'V' :: rest =&amp;gt; 5 + roman(rest)
  case 'X' :: 'L' :: rest =&amp;gt; 40 + roman(rest)
  case 'X' :: 'C' :: rest =&amp;gt; 90 + roman(rest)
  case 'L' :: rest =&amp;gt; 10 + roman(rest)
  case 'C' :: 'D' :: rest =&amp;gt; 400 + roman(rest)
  case 'C' :: 'M' :: rest =&amp;gt; 900 + roman(rest)
  case 'C' :: rest =&amp;gt; 100 + roman(rest)
  case 'D' :: rest =&amp;gt; 500 + roman(rest)
  case 'M' :: rest =&amp;gt; 1000 + roman(rest)
  case _ =&amp;gt; 0
}

val a = args
val b = a.toList
val c = roman(b)
println(c)

---------------------------------------------------------
tom&amp;lt; at &amp;gt;xps ~/t/c03 $ scala rn IV
/home/tom/t/c03/rn:19: error: type mismatch;
 found   : List[String]
 required: List[Char]
val c = roman(b)
    &lt;/pre&gt;</description>
    <dc:creator>TavMem</dc:creator>
    <dc:date>2012-05-18T11:56:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53423">
    <title>java.lang.UnsupportedOperationException: Scala reflection not available on this platform</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53423</link>
    <description>&lt;pre&gt;Hi,

I use 2.10.0-M3.

How to enable Scala reflection?

Thanks!
&lt;/pre&gt;</description>
    <dc:creator>Guofeng Zhang</dc:creator>
    <dc:date>2012-05-18T08:27:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53422">
    <title>Reified generics and self types</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53422</link>
    <description>&lt;pre&gt;Dear Scala experts,
I have a problem and I am looking for a reasonable approach to solve
it which doesn't pollute my code too much.

I have a builder which takes as input a Traversable[T] and produces
three Option[SpecializedCollection[T,K,Repr]] where

SpecialiedCollection[T,K,Repr] has two methods

  def disableLonger(newLimit:Double):Repr

  def doStuff(stuff: MyGenericClass[K]):Unit


The idea is that according to the T, this will be put into my
SpecializedCollectionImpl1, 2 or 3.  In fact K could be only of three
different classes.

However, things become complicated because in some cases I would need
to access these three Option[SpecializedCollection[T,K,Repr]] as if it
was only one.

I have designed a container class, but dealing with generics and self
types becomes almost a nightmare:



class TheThreeCollections[T &amp;lt;: MyClass, +R &amp;lt;:
MySpecializedCollection1[T, R], K &amp;lt;: MySpecializedCollection2[T, K],
+L &amp;lt;: MySpecializedCollection3[T, L]](coll1: Option[R], coll2:
Option[K],
  coll3: Option[L])
  exten&lt;/pre&gt;</description>
    <dc:creator>Edmondo Porcu</dc:creator>
    <dc:date>2012-05-18T07:06:23</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53421">
    <title>Re: How to implements something like Proxy.newProxyInstance in scala style?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53421</link>
    <description>&lt;pre&gt;Wrap the function.
def withLog2[A, B, C](f: (A,B)=&amp;gt;C) = (a: A, b: B) =&amp;gt; {
  log("input: (%s, %s)" format (a, b)
  val ret = f(a,b)
  log("return: " + ret)
  ret
}


On Fri, May 18, 2012 at 1:29 AM, wang zaixiang &amp;lt;wangzaixiang-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt;wrote:

&lt;/pre&gt;</description>
    <dc:creator>Naftoli Gugenheim</dc:creator>
    <dc:date>2012-05-18T05:53:05</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53420">
    <title>RE: implicit conversion of values vs types</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53420</link>
    <description>&lt;pre&gt;Hi Reid,

you can assign d + m to m + d of you Matrix class like this

implicit def scalarOp(d: Double) = new {
  def +(matrix: Matrix): Matrix = matrix + d
  def *(matrix: Matrix): Matrix = matrix * d
}

I can't see a need to look up m's dimension, this should be solve by m + d.

notes:
1) It shouldn't be necessary to blow up d to a matrix. In case of a huge m that will take some time and then doing defer to m + m' is snd step. Just loop through you m and add d to achieve m + d
2) new {...} is short and doesn't populate the name space but it takes some time. You can do:

implicit def scalarOp(d: Double) = new ScalarOp(d)

class ScalarOp(d: Double) {
  def +(matrix: Matrix): Matrix = matrix + d
  def *(matrix: Matrix): Matrix = matrix * d
}

Hope this helps,
Volker.

-----Original Message-----
From: scala-user&amp;lt; at &amp;gt;googlegroups.com [mailto:scala-user&amp;lt; at &amp;gt;googlegroups.com] On Behalf Of Reid Hartenbower ?
Sent: 18 May 2012 02:09
To: scala-user
Subject: [scala-user] implicit conversion of va&lt;/pre&gt;</description>
    <dc:creator>Bardenhorst, Volker Dr.</dc:creator>
    <dc:date>2012-05-18T05:49:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53419">
    <title>How to implements something like Proxy.newProxyInstance in scala style?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53419</link>
    <description>&lt;pre&gt;I would like to write such a function:

def withLog( func: T ): T 

The functions is something like:

def sum(i1: Int, i2: Int) = i1 + i2

and the returning function of withLog(sum _ _) maybe something like:

def sum1WithLog( i1: Int, i2: Int) = {
   log("before call of sum args= %d %d" format (i1, i2);
   val result = sum(i1, i2)
   log("after call with result = %d" format result)
   result
}

also , withLog can process other functions with different arg types, and 
inject AOP logic such as log function parameter, return values, call time, 
etc.

By using Java, we can using Proxy.newProxyInstance to wrap an interface and 
inject AOP code, but how can we do such for Scala Function?

&lt;/pre&gt;</description>
    <dc:creator>wang zaixiang</dc:creator>
    <dc:date>2012-05-18T05:29:30</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53418">
    <title>Re: implicit conversion of values vs types</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53418</link>
    <description>&lt;pre&gt;More like trying to show up √iktor Ҡ!

On Thu, May 17, 2012 at 8:08 PM, ℝeid Hartenbower ♻ &amp;lt;reid&amp;lt; at &amp;gt;hartenbower.com&amp;gt;wrote:

&lt;/pre&gt;</description>
    <dc:creator>Arya Irani</dc:creator>
    <dc:date>2012-05-18T00:29:02</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53417">
    <title>implicit conversion of values vs types</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53417</link>
    <description>&lt;pre&gt;Hi list

I am trying to implement octave/matlab style matrices which support a 
kind of expression-informed implicit conversion.

For example, if I have a 1x3 matrix (or row vector) m = [1 2 3] and I type
     2 + m
or
     m + 2
the scalar is effectively converted to a 1x3 matrix [2 2 2] and that 
added to m; the result is
     [3 4 5]

Given a general
     scalarA + matrixB
expression, I want to implicitly convert scalarA to a matrix of 
dimension matching matrixB, but how?  I get as far as:

implicit def scalarToMatrix(d: Double)(implicit matDims :(Int, Int)): 
Matrix = ...

But how do I get 'matDims' from 'matrixB' in an implicit way?  If I 
can't, what is the cleanest alternative?

p.s. Please forgive if this question has been previously answered, that 
must be a problem with another conversion (question -&amp;gt; google vector)


&lt;/pre&gt;</description>
    <dc:creator>ℝeid Hartenbower ♻</dc:creator>
    <dc:date>2012-05-18T00:08:46</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53416">
    <title>Scala+Java compilation fails during some Moon Phases</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53416</link>
    <description>&lt;pre&gt;Hello!

It is probably a bug. But it might be me missing something about Scala-
Java interop (which usually works perfectly!).
Let's write 2 classes in Java.

public class J&amp;lt;T&amp;gt; {
    public class Inner {}

    public void call(Inner i) {
        System.out.println("ja");
    }
}

public class J2&amp;lt;T&amp;gt; extends J&amp;lt;T&amp;gt; {
    public void call(Inner i) {
        System.out.println("va");
    }
}

Now let's extend them in Scala.

class S extends J[String] {
    override def call(i: J[String]#Inner) = println("sca")
}

class S2 extends J2[String] {
    override def call(i: J[String]#Inner) = println("la")
}

Compilation fails.
[info] Compiling 1 Scala source and 2 Java sources to D:\dev\my\lazer
\target\sca
la-2.9.1\classes...
[error] D:\dev\my\lazer\S.scala:2: method call overrides nothing
[error]     override def call(i: J[String]#Inner) = println("sca")
[error]                  ^
[error] D:\dev\my\lazer\S.scala:6: method call overrides nothing
[error]     override def call(i: J[String]#Inner) = println("la")
[error] &lt;/pre&gt;</description>
    <dc:creator>Sasha Kazachonak</dc:creator>
    <dc:date>2012-05-17T15:24:02</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53415">
    <title>Re: Class =&gt; Interface = &gt; Class</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53415</link>
    <description>&lt;pre&gt;Hi,
maybe I'm missing something...
Why can't you just accept a MySpecializedCollectionForT3 as a parameter, if 
you expect to use a specific method of this class in your method?

bye,
Ivano

On Thursday, May 17, 2012 3:22:38 PM UTC+2, edmondo1984 wrote:
&lt;/pre&gt;</description>
    <dc:creator>pagoda_5b</dc:creator>
    <dc:date>2012-05-17T13:53:40</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53414">
    <title>Class =&gt; Interface = &gt; Class</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53414</link>
    <description>&lt;pre&gt;Dear all,

I have the following use case:

I have a method which receives a three MyCollection[T1] ,
MyCollection[T2], MyCollection[T3].

I know that all MyCollection[T3] are of type
MySpecializedCollectionForT3 extends MyCollection[T3] and inside this
method I have access a special method of MySpecializedCollectionForT3.
I can code an implicit conversion of type :

implicit def specialize(myCollection:MyCollection[T3]) =
myCollection.asInstanceOf[MySpecializedCollectionForT3]


Is there a better solution for that?

Best Regards

Edmondo

&lt;/pre&gt;</description>
    <dc:creator>Edmondo Porcu</dc:creator>
    <dc:date>2012-05-17T13:22:38</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53413">
    <title>Re: "Begiinning Scala" book by David Pollack</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53413</link>
    <description>&lt;pre&gt;Thanks!!
Turns out that the postings on 
http://ilopez.com/post/858172040/adventures-in-scala-sum-java
and on 
http://scala-programming-language.1934581.n4.nabble.com/Beginning-Scala-book-problem-tt2966867.html#none
also work, when the inputs are entered correctly.

I misunderstood the input specs and  I thought that you could enter a 
string of numbers on each input line, so

tom&amp;lt; at &amp;gt;xps ~/t/c02 $ scala Sum.scala
Enter some numbers and press ctrl-D (Unix/Mac) ctrl-C (Windows)
1 
2
3
4
Sum 10

works fine, but

tom&amp;lt; at &amp;gt;xps ~/t/c02 $ s Sum
Enter some numbers and press ctrl-D (Unix/Mac) ctrl-C (Windows)
1 2
3 4
Sum 0

Gives a result of 0 (which I thought was an error).




On Thursday, May 17, 2012 8:01:00 AM UTC-4, √iktor Klang wrote:
&amp;gt; &lt;/pre&gt;</description>
    <dc:creator>TavMem</dc:creator>
    <dc:date>2012-05-17T12:52:23</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53412">
    <title>Re: "Begiinning Scala" book by David Pollack</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53412</link>
    <description>&lt;pre&gt;This works great for me:

io.scala
------------

def toInt(in: String): Option[Int] = try Some(Integer.parseInt(in.trim))
catch { case _: NumberFormatException =&amp;gt; None }

def sum(in: TraversableOnce[String]) = in.flatMap(toInt).foldLeft(0)((a, b)
=&amp;gt; a + b)

println("Enter some numbers and press ctrl-D (Unix/Mac) ctrl-C (Windows)")

println("Sum "+sum(scala.io.Source.fromInputStream(System.in).getLines))

➜  Desktop  scala io.scala
Enter some numbers and press ctrl-D (Unix/Mac) ctrl-C (Windows)
45
10
5
Sum 60

On Thu, May 17, 2012 at 1:29 PM, TavMem &amp;lt;tavmem-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:



&lt;/pre&gt;</description>
    <dc:creator>√iktor Ҡlang</dc:creator>
    <dc:date>2012-05-17T12:01:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53411">
    <title>Re: "Begiinning Scala" book by David Pollack</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53411</link>
    <description>&lt;pre&gt;Changing to
   val pf: PartialFunction[String, String] = { case x =&amp;gt; x }
does not help.

On Thursday, May 17, 2012 7:01:55 AM UTC-4, TavMem wrote:
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/pre&gt;</description>
    <dc:creator>TavMem</dc:creator>
    <dc:date>2012-05-17T11:29:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53410">
    <title>Re: "Begiinning Scala" book by David Pollack</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53410</link>
    <description>&lt;pre&gt;Based on the suggestions in 
http://www.scala-lang.org/node/6665
it would seem that the following would work (but it does not):

import scala.io._ 

def toInt(in: String): Option[Int] = 
  try { 
    Some(Integer.parseInt(in.trim)) 
  } catch { 
    case e: NumberFormatException =&amp;gt; None 
  } 

def sum(in: Seq[String]) = { 
  val ints = in.flatMap(s =&amp;gt; toInt(s)) 
  ints.foldLeft(0)((a, b) =&amp;gt; a + b) 
} 

println("Enter some numbers and press ctrl-D (Unix/Mac) ctrl-C (Windows)") 

val input = Source.fromInputStream(System.in) 

val pf: PartialFunction[Int, Int] = { case x =&amp;gt; x }

val lines = input.getLines.collect pf

println("Sum "+sum(lines))


On Thursday, May 17, 2012 6:25:11 AM UTC-4, TavMem wrote:
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/pre&gt;</description>
    <dc:creator>TavMem</dc:creator>
    <dc:date>2012-05-17T11:01:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53409">
    <title>Re: "Begiinning Scala" book by David Pollack</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53409</link>
    <description>&lt;pre&gt;There is another solution at
http://scala-programming-language.1934581.n4.nabble.com/Beginning-Scala-book-problem-tt2966867.html#none
This fix also does not result in a correct sum in scala 2.9.2

On Thursday, May 17, 2012 6:15:32 AM UTC-4, TavMem wrote:
&amp;gt;&amp;gt;&amp;gt;&lt;/pre&gt;</description>
    <dc:creator>TavMem</dc:creator>
    <dc:date>2012-05-17T10:25:11</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53408">
    <title>Re: "Begiinning Scala" book by David Pollack</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53408</link>
    <description>&lt;pre&gt;There is a "fix" posted on 
http://ilopez.com/post/858172040/adventures-in-scala-sum-java
which does get rid of the immediate error.
However, the script then gives the result = 0
for whatever numbers are entered.

On Thursday, May 17, 2012 5:30:59 AM UTC-4, TavMem wrote:
&amp;gt;&amp;gt;&lt;/pre&gt;</description>
    <dc:creator>TavMem</dc:creator>
    <dc:date>2012-05-17T10:15:32</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53407">
    <title>Re: "Begiinning Scala" book by David Pollack</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53407</link>
    <description>&lt;pre&gt;tom&amp;lt; at &amp;gt;xps Chapter02 $ s Sum.scala
Chapter02/Sum.scala:19: error: missing arguments for method collect in 
trait Iterator;
follow this method with `_' if you want to treat it as a partially applied 
function
val lines = input.getLines.collect
                           ^
one error found


On Thursday, May 17, 2012 12:54:09 AM UTC-4, nafg wrote:
&amp;gt;&lt;/pre&gt;</description>
    <dc:creator>TavMem</dc:creator>
    <dc:date>2012-05-17T09:30:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53406">
    <title>Re: Local-global variables, partial classes, cake pattern?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53406</link>
    <description>&lt;pre&gt;
I find that's usually the best way ;-)

Cheers,


Miles

&lt;/pre&gt;</description>
    <dc:creator>Miles Sabin</dc:creator>
    <dc:date>2012-05-17T08:30:23</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53405">
    <title>Re: "Begiinning Scala" book by David Pollack</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53405</link>
    <description>&lt;pre&gt;Do you mind telling us what the error is, so we know what we're trying to
come up with a fix for?


On Wed, May 16, 20i12 at 10:41 PM, Tom Szczesny &amp;lt;tavmem-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

&lt;/pre&gt;</description>
    <dc:creator>Naftoli Gugenheim</dc:creator>
    <dc:date>2012-05-17T04:54:09</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.user/53404">
    <title>"Begiinning Scala" book by David Pollack</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.user/53404</link>
    <description>&lt;pre&gt;On page 16:   the very first non-trivial example of a Scala script.
This script produces an error using Scala version 2.9.2
It has been noted in the errata by more than one person, but there is
no fix listed.
If anyone has any idea concerning a fix, please let me know.
The script is named Sum.scala and is:


import scala.io._

def toInt(in: String): Option[Int] =
  try {
    Some(Integer.parseInt(in.trim))
  } catch {
    case e: NumberFormatException =&amp;gt; None
  }

def sum(in: Seq[String]) = {
  val ints = in.flatMap(s =&amp;gt; toInt(s))
  ints.foldLeft(0)((a, b) =&amp;gt; a + b)
}

println("Enter some numbers and press ctrl-D (Unix/Mac) ctrl-C (Windows)")

val input = Source.fromInputStream(System.in)

val lines = input.getLines.collect

println("Sum "+sum(lines))

&lt;/pre&gt;</description>
    <dc:creator>Tom Szczesny</dc:creator>
    <dc:date>2012-05-17T02:41:46</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lang.scala.user">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.lang.scala.user</link>
  </textinput>
</rdf:RDF>

