Proposed levels of skill for the scala programming language, can be used as a base for a curriculum
Related links:
- the scala style guide.
- a scala basic exam
- examples of scala abuses
- sample training curriculum Artima
Proposed levels of skill for the scala programming language, can be used as a base for a curriculum
Related links:
Scala is a wonderful language, with a specification of a size comparable with that of Java. Overall, the specification is simpler than C++. Why then do some feel intimidated by its expressiveness?
Scala can generate complex constructs. There are some features of the language that, if not used properly, can negatively influence one's perception of its simplicity and generate a waste of many an hour of a frustrated developer.
Newcomers from simply typed, object-oriented, structured languages do not have a full grasp of all the features of scala and their effects or benefits, and they may be very surprised if others on their team use them.
One thing to have when starting or using scala is a readily available bible. I recommend "Programming in Scala", the .pdf version, an easily searcheable language reference.
The scala style guide is very good. Here we will describe the advanced features of the language, which are aimed at library-developers and should not b
v(c) (c ? P | c ! Q) |
par { | |
seq { | |
inc | |
log($0) | |
} | |
seq { | |
inc | |
log($0) | |
} | |
} |
wif (_ == 1) { | |
inc + log ($0) | |
} welse { | |
inc + inc + log ($0) | |
} |
class Interpreter(val settings: Settings, out: PrintWriter) { | |
repl => | |
// 1. Request is private. I need: dependencies (usedNames?) newly defined values (boundNames?) | |
// the resulting value and the error message(s) if any | |
case class PublicRequest (usedNames : List[String], valueNames:List[String], extractionValue:Option[Any]) | |
// 2. Can't get the last request |
trait InterpolationContext { | |
implicit def str2interp(s: String) = new InterpolatedString(s) | |
class InterpolatedString(val s: String) { | |
def / = interpolate(s) | |
def identifier = s.substring(2, s.length - 1) | |
} | |
object Tokenizer { | |
def unapply(s: String): Option[Iterator[String]] = { |
/** | |
* minimal script interface | |
* | |
* TODO use JSR 264 or whatever the thing is and ditch custom code... | |
* | |
* @author razvanc | |
*/ | |
trait RazScript { | |
import RazScript._ |
def f(x:Int)=1+2 |