您好,欢迎光临本网站![请登录][注册会员]  
文件名称: ScalaByExample
  所属分类: Java
  开发工具:
  文件大小: 3mb
  下载次数: 0
  上传时间: 2011-09-01
  提 供 者: liuwanz*******
 详细说明: 1 Introduction 1 2 A First Example 3 3 Programming with Actors andMessages 7 4 Expressions and Simple Functions 11 4.1 Expressions And Simple Functions . . . . . . . . . . . . . . . . . . . . . . 11 4.2 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.3 Conditional Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.4 Example: Square Roots by Newton’sMethod . . . . . . . . . . . . . . . . 15 4.5 Nested Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.6 Tail Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 5 First-Class Functions 21 5.1 Anonymous Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 5.2 Currying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.3 Example: Finding Fixed Points of Functions . . . . . . . . . . . . . . . . 25 5.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.5 Language Elements Seen So Far . . . . . . . . . . . . . . . . . . . . . . . 28 6 Classes and Objects 31 7 Case Classes and PatternMatching 43 7.1 Case Classes and Case Objects . . . . . . . . . . . . . . . . . . . . . . . . 46 7.2 PatternMatching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 8 Generic Types andMethods 51 8.1 Type Parameter Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 8.2 Variance Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 8.3 Lower Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 8.4 Least Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 8.5 Tuples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 8.6 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Lists 63 9.1 Using Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 9.2 Definition of class List I: First OrderMethods . . . . . . . . . . . . . . . 65 9.3 Example: Merge sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 9.4 Definition of class List II: Higher-OrderMethods . . . . . . . . . . . . . 70 9.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 0 For-Comprehensions 79 10.1 The N-Queens Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 10.2 Querying with For-Comprehensions . . . . . . . . . . . . . . . . . . . . . 81 10.3 Translation of For-Comprehensions . . . . . . . . . . . . . . . . . . . . . 82 10.4 For-Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 10.5 Generalizing For . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 1 Mutable State 87 11.1 Stateful Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 11.2 Imperative Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . 91 11.3 Extended Example: Discrete Event Simulation . . . . . . . . . . . . . . . 92 11.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 2 Computing with Streams 99 3 Iterators 103 13.1 IteratorMethods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 13.2 Constructing Iterators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 13.3 Using Iterators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 4 Lazy Values 109 5 Implicit Parameters and Conversions 113 ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: scala
 输入关键字,在本站1000多万海量源码库中尽情搜索: