Are there code examples comparing Scala and JavaFX Script? -
I am studying JavaFX scripts and trying to compare it to Scala, which is the one for Java platform And very interesting is the new language. / P>
I found the official Scal site, which is a quick sequential implementation, I have then written the following equivalent JavaFX script program (using Netbeans IDE 6.7.1):
package example ; Function sort (A: integer []): integer [] (if (size & size; 2 size) another {def pivot = one [size a / 2]; [sort (a [n] and lt ; Pivot]), a [N | N == smoke], sort (a [n | n> smoke]);}} function run (args: string []) {def xs = [6, 2, 8] , 5, 1]; println (xs); println (type (xs))}
Both functional programs are very similar, but I like the JavaFX version better. Those "_" and ":::" parties are not very attractive to me I guess ...
Of course, there is a lot more to both languages, so I see more examples. Does anyone know where I can find something? Or even better , Other examples here
Keep in mind that Scala syntax is flexible. : "And" _ "can be written without the following:
package example / ** quick type, functional style * / item sort1 {def sort (a: list [en] T]): list [int] = {if (ally and lieutenant; 2) Another (wall pivot = a (aline / 2) list. Colnet (sort (suffix = (n = & gt; n & lt; pivot)), a.filter (n = & gt; n == smoke ), Sort (Ffalt (n = & gt; n> Pivot))}} Def main (args: array [string]) {Val xs = list (6, 2, 8, 5, 1) println ( Xs) println (sort (xs))}}
For code comparison, I usually have many scala examples, but there are no JavaFX if you participate in this project, Please take the time to add some Java FX to that site.: -)
< / Div>
Comments
Post a Comment