1 / 14
文档名称:

Basic Scala - University of Pennsylvania:基本的Scala -宾夕法尼亚大学.ppt

格式:ppt   页数:14页
下载后只包含 1 个 PPT 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

Basic Scala - University of Pennsylvania:基本的Scala -宾夕法尼亚大学.ppt

上传人:薄荷牛奶 2016/4/17 文件大小:0 KB

下载得到文件列表

Basic Scala - University of Pennsylvania:基本的Scala -宾夕法尼亚大学.ppt

相关文档

文档介绍

文档介绍:Reinventing the wheel ? When you learn a foreign language, you learn both the grammar (syntax) and the vocabulary ? If you learn just a few hundred words, you can usually make yourself understood (though you may not understand other people), but that doesn ’ t make you fluent in the language ? If you were writing in the foreign language, you would use a dictionary to express yourself better ? When you learn a programming language, you learn both the syntax and the libraries ( “ vocabulary ”) ? You can write (almost) any program using only the syntax ? if (me == "Tarzan") you = "Jane" ? You are not “ speaking ” Scala, you are writing it ? Learn to use the libraries! 1 Converting to lowercase ? scala> :paste // Entering paste mode (ctrl-D to finish) val s = "Letters AND digits, 1 2 3!" var lc = "" for (ch <- s) { if (ch >= 'A' && ch <= 'Z') { lc = lc + (ch - 'A' + 'a').toChar } else { lc = lc + ch } } (Entered ctrl-D) // Exiting paste mode, now interpreting. s: String = Letters AND digits, 1 2 3! lc: String = letters and digits, 1 2 3! ? scala> val lc2 = lc2: String = letters and digits, 1 2 3! 2 Discovering methods in the REPL ? In the REPL, you can hit a tab after a period to find out what methods are available ? scala> "abc". TAB + asInstanceOf charAt codePointAt codePointBefore codePointCount compareTo compareToIgnoreCase concat contains contentEquals endsWith equalsIgnoreCase getBytes getChars indexOf intern isEmpty isInstanceOf lastIndexOf length matches offsetByCodePoints regionMatches replace replaceAll replaceFirst split startsWith subSequence substring toCharArray

最近更新

2024年感动话题作文 17页

小学六年级英语期中检测试卷分析 4页

小学六年级英语基数词与序数词对照表 1页

模型修正中的若干问题研究的开题报告 2页

2024年情侣QQ签名 43页

2024年悲惨世界读后感八百字 8页

植物与AM真菌物种多样性相互关系的初步研究的.. 2页

2024年恭喜买房子的祝福语 21页

2024年总监代表岗位职责(通用9篇) 8页

核能系统用钛基非氧化物陶瓷的制备及性能研究.. 2页

小学六年级体音美模拟试题 (2) 2页

校本理念下教师专业发展多元策略的研究中期报.. 2页

树的子树的计数的开题报告 2页

柔性轴车削加工工艺研究的开题报告 2页

染料废水混凝污泥免烧砖浸出毒性的研究的开题.. 2页

某高层钢结构体系方案优化设计中期报告 2页

某电动汽车副车架结构性能分析及优化的开题报.. 2页

某大吨位运输车液压系统可靠性分析研究的开题.. 2页

2024年快乐的小学作文(精品9篇) 9页

枣裂果机制及其影响因素的研究的开题报告 2页

2024年志愿者活动总结汇总(14篇) 43页

电梯维保报价书 3页

棋牌室培训资料 20页

电镀黑铬工艺 10页

电镀六价铬讲议 10页

计算机桌面运维技术服务方案 32页

老年慢性阻塞性肺疾病呼吸衰竭患者经鼻气管插.. 5页

《博微电力工程经济评价软件使用手册》 38页

少先队植树造林歌 19页

《我和星星打电话》课件 7页