You are comparing an array of integers with an integer. You would want to do this instead:
for (y <- x if y > 2) ...Get some sleep, then spend another week playing with Scala and its REPL. It's a terrific tool to learn. If you like Eclipse, install the Scala IDE and the Scala Worksheet. It's rough around the edges, but it's even better than the REPL.
Yes, I have been using the Scala IDE and Scala worksheet for my initial learning. As you said, it is great and more friendly than the REPL itself. It reminds me of Python Notebook in terms of being able to get good feedback and recursively edit.
Re:View of Scala from Java
by thebluesky on Friday January 04, 2013 @03:36AM
(#5006805)
Most folks find that the IntelliJ Scala plugin is the best tool rather than Eclipse.
Have you tried the Scala Worksheet for Eclipse? Pretty cool.
I see that the recently released IDEA 12 has a similar feature (but so far incomplete and undocumented according to their bug tracker).
Edit: Yeah, I see the silly error I made. I'll better get some sleep. I will leave this comment intact, for the responses to make sense.