I'm trying to port some Java code into Scala:
while ((j=f('blah'))>=0) ...
ERROR:"value >= is not a member of Unit"
Is this not possible?
Assignments return ()
(unit) in Scala. But that's okay because you can put a code block anywhere. You need this instead:
while ({ j=f("blah"); j } >= 0) ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With