Scripster - interactive scala script pad
//crash-course into scala: select the following defs and issue "run selection" class Num (val i:Int) { def + (other:Num) = new Num (this.i + other.i) // operators override def toString : String = "Numero " + i.toString // inherit Java methods override def equals (other:Any) = other match { // or override them case n:Num => n.i == i case _ => false // wildcard serves like a default case } } object Num { // companion object contains statics for Num def apply (i:Int) = new Num (i) // this lets you do Num(3) instead of new Num(3) def valueOf (s:String) = new Num (s.toInt) } implicit def toNum (i:Int) = Num (i) // this makes the conversion implicit def add (i:Num*) = { // variable argument list val ss = "12344" // type inferred as String var ii = Num(0) for (k <- i) ii = ii + k // boo hoo - the way of the java... assert (ii == i.foldLeft (Num(0)) (_+_)) // woo hoo - the way of the lambda ... ii } //move cursor to following line and issue "run line" add (1+2, 8/4) // see the implicit conversion? //move cursor to end of following line and press ctrl+space for content assist java.lang.Sys
F9 - Run Line|Ctrl+F9 - Run Selection|Reset|Simple style|Witty

Status is updated here...

Notice

Try and share scala code, using the Scripster, @2010 by Razvan Cojocaru. See the guide, forum or brush up on your scala.

The current version is built on scala 2.9.1 and includes scalaz 6.0.1, a scala workflow DSL and the snakking framework. If you'd like to see more libraries included, please post on the forum.

Please note that this is a server that runs somewhere, i.e.

println ("Hello")
will print in the server log files. If you want to see
3
just type
1+2
... not
println(1+2)

Known issues:

Some of the 3rd party libraries used:

Terms: the "blah-blah"

This service is provided as is, no warranties implied. You use it at your own risk. It may crap out, stop working, be discontinued or changed to a yellow & red pallette at any time, just to mess with you...of course, we'll get you to pay, to get nice colors... :) nah...just messing with ya'...

See current issues and please report new issues or enhancements here.

Customizing

When reusing the scripster library in your code, to customize this notice, put a "/public/scripster.html" in your classpath. An empty file should eliminate this (good in swing).