2015年9月18日
摘要: package com.leegh.actorimport scala.actors.Actor/** * @author Guohui Li */object First_Actor extends Actor { def act() { for (i <- 1 to 10) { ... 阅读全文
posted @ 2015-09-18 21:43 李格非 阅读(166) 评论(0) 推荐(0) 编辑
  2015年9月17日
摘要: package com.leegh.implicitsimport scala.io.Sourceimport java.io.File/** * @author Guohui Li */class RicherFile(val file: File) { def read = Source.fr... 阅读全文
posted @ 2015-09-17 08:51 李格非 阅读(151) 评论(0) 推荐(0) 编辑
  2015年9月16日
摘要: package com.leegh.implicits/** * @Tuthor Guohui Li */abstract class Template[T] { def add(x: T, y: T): T}abstract class SubTemplate[T] extends Templa... 阅读全文
posted @ 2015-09-16 08:21 李格非 阅读(144) 评论(0) 推荐(0) 编辑
  2015年9月15日
摘要: package com.leegh.implicitsimport java.io.Fileimport scala.io.Source/** * @author Guohui Li */object Context_Helper { implicit class FileEnhance(file... 阅读全文
posted @ 2015-09-15 10:32 李格非 阅读(110) 评论(0) 推荐(0) 编辑
  2015年9月14日
摘要: package com.leegh.implicits/** * @author Guohui Li *///类型参数可以有一个形式为T:M的上下文界定,其中M是另一个泛型类型。它要求作用域中存在一个类型为M[T]的隐式值class Pair_Implicits[T: Ordering](val f... 阅读全文
posted @ 2015-09-14 08:14 李格非 阅读(168) 评论(0) 推荐(0) 编辑
  2015年9月13日
摘要: package com.leegh.implicits/** * @author Guohui Li */object Implicit_Conversions_with_Implicit_Parameters { def main(args: Array[String]): Unit = { ... 阅读全文
posted @ 2015-09-13 09:29 李格非 阅读(101) 评论(0) 推荐(0) 编辑
  2015年9月12日
摘要: package com.leegh.implicits/** * @author Guohui Li */object Context_Implicits { implicit val default: String = "java"}object Param { def print(conte... 阅读全文
posted @ 2015-09-12 11:12 李格非 阅读(200) 评论(0) 推荐(0) 编辑
  2015年9月11日
摘要: package com.leegh.implicitsimport scala.io.Sourceimport java.io.File/** * @author Guohui Li */class RichFile(val file: File) { def read = Source.from... 阅读全文
posted @ 2015-09-11 19:29 李格非 阅读(243) 评论(0) 推荐(0) 编辑
  2015年9月10日
摘要: package com.leegh.parameterizationimport scala.io.BufferedSourceimport scala.io.Source/** * @author Guohui Li */trait Reader { type In <: java.io.Ser... 阅读全文
posted @ 2015-09-10 09:19 李格非 阅读(178) 评论(0) 推荐(0) 编辑
  2015年9月9日
摘要: package com.leegh.parameterization/** * @author Guohui Li */trait Logger { def log(msg: String) }trait Auth { auth: Logger => def act(msg: String) {... 阅读全文
posted @ 2015-09-09 17:35 李格非 阅读(176) 评论(0) 推荐(0) 编辑