上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 55 下一页
摘要: How to use type alias to name a Tuple2 pair into a domain type called CartItem type CartItem[Donut, Int] = Tuple2[Donut, Int] 阅读全文
posted @ 2019-07-12 11:13 嵌入式实操 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Partial函数的定义 scala> val isVeryTasty: PartialFunction[String, String] = { case "Glazed Donut" | "Strawberry Donut" => "Very Tasty"}isVeryTasty: Partial 阅读全文
posted @ 2019-07-12 10:59 嵌入式实操 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 可以使用scala库,可以从字面上看出是在调用 递归函数: code resule: 阅读全文
posted @ 2019-07-12 10:02 嵌入式实操 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Ordering using andThen: f(x) andThen g(x) = g(f(x)) Ordering using compose: f(x) compose g(x) = f(g(x)) result: 阅读全文
posted @ 2019-07-12 09:50 嵌入式实操 阅读(81) 评论(0) 推荐(0) 编辑
摘要: Scala collection such as List or Sequence or even an Array to variable argument function using the syntax :_ *. code : result: 阅读全文
posted @ 2019-07-11 17:57 嵌入式实操 阅读(103) 评论(0) 推荐(0) 编辑
摘要: result 阅读全文
posted @ 2019-07-11 17:39 嵌入式实操 阅读(102) 评论(0) 推荐(0) 编辑
摘要: result: 实例对象 stack 只能接受整型值。然而,如果类型参数有子类型,子类型可以被传入: class Fruit class Apple extends Fruit class Banana extends Fruit val stack = new Stack[Fruit] val a 阅读全文
posted @ 2019-07-10 16:26 嵌入式实操 阅读(136) 评论(0) 推荐(0) 编辑
摘要: code: result: 阅读全文
posted @ 2019-07-10 16:14 嵌入式实操 阅读(109) 评论(0) 推荐(0) 编辑
摘要: svn diff --summarize 阅读全文
posted @ 2019-07-10 15:54 嵌入式实操 阅读(851) 评论(0) 推荐(0) 编辑
摘要: result: 阅读全文
posted @ 2019-07-10 15:53 嵌入式实操 阅读(156) 评论(0) 推荐(0) 编辑
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 55 下一页