You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@paulp said (edited by @som-snytt on Aug 31, 2013 5:40:52 PM UTC):
Sorry, this is a limitation of the interpreter. val half = if (x) y is a valid statement all by itself, so when you press enter it is processed. Avoiding this would require forcing everyone to press enter twice all the time, which is no good.
You can do this:
valhalf= (
if (n %2==0)
n /2elsethrownewRuntimeException("n must be even")
)
Open scala interpreter and load a file that contains
--> illegal start of definition
whereas
works fine.
The text was updated successfully, but these errors were encountered: