Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Created August 5, 2011 11:09
Show Gist options
  • Save xuwei-k/1127322 to your computer and use it in GitHub Desktop.
Save xuwei-k/1127322 to your computer and use it in GitHub Desktop.
twitter util の Eval の使い方
#!/usr/bin/env xsbtscript
!#
/***
scalaVersion := "2.8.1"
resolvers += "twiiter repo" at "http://maven.twttr.com"
libraryDependencies ++= Seq(
"com.twitter" % "util-eval" % "1.11.0"
)
scalacOptions += "-deprecation"
*/
import com.twitter.util.Eval
try{
val a = Eval[Int]("""1 to 10 sum""")
println(a)
}catch{
case e => println(e)
}
./EvalTest
./EvalTest.scala:21: object Eval in package util is deprecated: use a throw-away instance of Eval instead
[warn] val a = Eval[Int]("""1 to 10 sum""")
[warn] ^
[warn] one warning found
55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment