Another whoa moment today -- ran across a pointed, concise Scala code snippet in Eric Torreborre's announcement of the
specs 1.1 testing library...
"a calculator" should {
"provide an add operation" in {
"a" | "b" | "result" |>
1 ! 2 ! 3 |
5 ! 2 ! 7 |
3 ! 0 ! 3 | {
(a: Int, b: Int, result: Int) => { calc.add(a, b) must_== result }
}
}
}
The above is a great example of Scala's deep DSL potential. Reminds me of wiki table syntax, right inline in with the code.
With the abilities of Scala, wouldn't you be able to whack down your own project's
codebase bloat?
Or, of course, rather than using Scala (available today!) you could just wait and hope for a nice ES4 or Java 7, 8 future.
You need to be a member of My Scala Base to add comments!
Join this Ning Network