Another day I'd say "I don't know. Have you considered telling us how
it doesn't work?"
Today though:
for (i <- 1 to 10;
f = i * 2;
if i * 2 == 3) println(f) // works
for { i <- 1 to 10
f = i * 2
if i * 2 == 3 } println(f) // works
2009/11/6 Kubitz, Jörg <
jkubitz@...>:
> I tried a mid-stream varible binding.
>
> This does not work:
>
>
>
> for (i <- 1 to 10
>
> f=i*2
>
> if i*2==3
>
> ) println(f)
>
>
>
>
>
> Why?
--
Ricky Clarkson
Java and Scala Programmer, AD Holdings
+44 1565 770804
Skype: ricky_clarkson
Google Talk:
ricky.clarkson@...
Google Wave:
ricky.clarkson@...