error: identifier expected but '(' found.
What you probably meant is that a b c
and a.b(c)
are the same thing. And admire the effect of the semicolons in http://article.gmane.org/gmane.comp.lang.scala.debate/2231scala> object Test { | def myMethod( f:(String,String)=>String) { | println("MyMethod result =" + f("a", "b")) | } | } defined module Test
scala> Test.myMethod( _ + "&" + _ ) MyMethod result =a&b
scala> Test.myMethod( (a,b)=> a+"&"+b ) MyMethod result =a&b
scala> Test.myMethod { (a,b)=>a+"&"+b } MyMethod result =a&b
case class Lol (a: Int, b: Int)
Lol(2, 3) match {
case x Lol y => x
}You can code a domain specific options parser in scala so that your final code actually looks like this -
"@ $20 spot, price 5 calls, @ $25 strike, 59 days to expiry"
This is as simple as it can get. In fact, the senior quants literally say the above line word for word. So its practically English. Can't get any simpler than that.
Reference: http://www.scala-lang.org/node/1403
Of course code is hard to read if you don't know the language.