我正在使用带有play2的java8,具有此配置.
name := """shipping"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayJava)
scalaVersion := "2.11.1"
libraryDependencies ++= Seq(
javaJdbc,
javaEbean,
cache,
javaWs,
"org.apache.axis" % "axis" % "1.4",
"net.sf.barcode4j" % "barcode4j" % "2.1",
"xml-apis" % "xml-apis" % "1.4.01",
"javax.xml" % "jaxrpc-api" % "1.1",
"org.webjars" % "flot" % "0.8.0",
"org.webjars" % "bootstrap" % "2.3.1",
"commons-discovery" % "commons-discovery" % "0.4",
"postgresql" % "postgresql" % "9.1-901.jdbc4",
"wsdl4j" % "wsdl4j" % "1.6.2",
"org.apache.xmlgraphics" % "fop" % "1.0"
)
javacOptions ++= Seq("-source", "1.8", "-target", …Run Code Online (Sandbox Code Playgroud) 大家好,我正在尝试理解scala中的符号"_",它看起来像一个通配符,但我不明白为什么在给定的场景中.
var l = List("a","b" ,"c")
// Works "s" works as a variable.
l.foreach( s =>
if(s=="a"){
print(s)
}
)
// Works _ takes the place of "s"
l.foreach(
print(_)
)
//So the doubt is whether "_" is a wildcard that does not work well.
l.foreach(
if(_=="a"){
print(_)
}
)
Run Code Online (Sandbox Code Playgroud)
"_"应该像变量一样s,但为什么不呢?
Python有Fabric库来执行这样的操作,Clojure有这样的选择吗?
我如何计算移动和网络访问权限从地图列表中丢弃零值?输出应该是这样的"统计移动= 1 web = 2",但所有其他语言都可以通过简单的i ++解决,但是如何在clojure中.谢谢.
def data [{:name "app1" :type "mobile" }
{:name "site1" :type "web" }
{:name "site1" :type "web" }
{:name "boot" :type nil }]
Run Code Online (Sandbox Code Playgroud)