搜索
人大经济论坛 附件下载

附件下载

所在主题:
文件名:  python-to-scala.pdf
资料下载链接地址: https://bbs.pinggu.org/a-2194870.html
附件大小:
385.99 KB   举报本内容
[hide][/hide]

  1. The goal of this project is to be a concise guide for those transitioning from Python to Scala. This is by no means meant to be a complete guide to Scala, but rather some (hopefully) helpful snippets of code to help you translate between the two languages.

  2. This guide loosely follows along with the text of Scala for the Impatient, a great introductory book for those learning Scala. You might find it helpful to read it alongside the chapters from this repo.

  3. Note that in general, you should not try to directly translate idioms from one language to another; you don't want to write Scala that looks like Python- you want to write Scala that looks like Scala! You should strive to write idiomatic code whenever possible. A good starting point is Twitter's Effective Scala

  4. I recommend reading through the guide in the following order:
  5. 1.Variables and Arithmetic
  6. 2.Conditionals
  7. 3.Functions
  8. 4.Strings
  9. 5.Arrays
  10. 6.Maps
  11. 7.Tuples
  12. 8.Exceptions
  13. 9.Classes

  14. Here are some Scala topics not discussed above that I think are important to review:
  15. •Pattern Matching This is like a switch statement on turbo, and is very powerful and oft used. The Scala Cookbook has really great practical examples.
  16. •Auxiliary Constructors Classes can have multiple constructors that operate on different argument types/number of args.
  17. •Case Classes as an immutable, record-like data-structure that can be pattern-matched.
  18. •Scala Collections There is a lot of power in all of the methods available to data structures like Vector, Array, List, Sequence, Set, etc. Just take a look at all of the available methods.

  19. All of the code for this book can be found on Github.
复制代码




    熟悉论坛请点击新手指南
下载说明
1、论坛支持迅雷和网际快车等p2p多线程软件下载,请在上面选择下载通道单击右健下载即可。
2、论坛会定期自动批量更新下载地址,所以请不要浪费时间盗链论坛资源,盗链地址会很快失效。
3、本站为非盈利性质的学术交流网站,鼓励和保护原创作品,拒绝未经版权人许可的上传行为。本站如接到版权人发出的合格侵权通知,将积极的采取必要措施;同时,本站也将在技术手段和能力范围内,履行版权保护的注意义务。
(如有侵权,欢迎举报)
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

GMT+8, 2025-12-31 07:07