Nice TWiki > Doc > NiceVersusScala (r1.21 vs. r1.22) TWiki webs:
Dev | Doc | Main | TWiki | Sandbox
Doc . { Changes | Index | Search | Go }
 <<O>>  Difference Topic NiceVersusScala (r1.22 - 26 Jul 2005 - TWikiGuest)
Changed:
<
<

Every Scala expression has a value, so there are fewer explicit return statements - I'm familiar with that from Smalltalk, so it's difficult to judge if I just like it because it's familiar. In some cases Scala syntax seems more consistent; Nice seems to extend Java and so add syntax. For example, def square(x: Int) = { var y=x; y*y } and def square(x: Int) = x*x; whereas Nice has int square(int x){ var y=x; return y*y; } and a shorthand form int square(int x) = x*x;

>
>

Every Scala expression has a value, so there are fewer explicit return statements - I'm familiar with that from Smalltalk, so it's difficult to judge if I just like it because it's familiar. In some cases Scala syntax seems more consistent; Nice seems to extend Java and so add syntax. For example, in Scala there is def square(x: Int) = { var y=x; y*y } which can be shortened to def square(x: Int) = x*x; whereas in Nice it is int square(int x){ var y=x; return y*y; } and the shorthand form is int square(int x) = x*x;


Topic NiceVersusScala . { View | Diffs | r1.22 | > | r1.21 | > | r1.20 | More }
Revision r1.21 - 03 Apr 2005 - 10:41 GMT - TWikiGuest
Revision r1.22 - 26 Jul 2005 - 07:21 GMT - TWikiGuest
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.