Thinking in Erlang - A Guide to Functional Programming in Erlang [Jan 2007 Robert Baruch].pdf


文档分类:管理/人力资源 | 页数:约32页 举报非法文档有奖
1/32
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/32
文档列表 文档介绍
Thinking in Erlang
A GUIDE TO FUNCTIONAL PROGRAMMING IN ERLANG FOR THE
EXPERIENCED PROCEDURAL DEVELOPER
Robert Baruch
autophile@
Version
January 31, 2007
Thinking in Erlang RIGHT HEADER HERE
Copyright
This work is licensed under the mons Attribution-Share Alike License. To
view a copy of this license, visit /licenses/by-sa// or send a letter
to mons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.
2
Thinking in Erlang RIGHT HEADER HERE
Contents
1 Introduction 4
What this document is not . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
What this document is . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Porting code to Erlang . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Hello, World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
and running . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Scope of variables 7
No global state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Dealing with no global state . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3 Matching 9
Basic matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Function argument matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
If and case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Guards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4 Loops 14
Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Less painful loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5 Processes 18
Doing two things at once . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
munication . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Process termination rea

Thinking in Erlang - A Guide to Functional Programming in Erlang [Jan 2007 Robert Baruch] 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数32
  • 收藏数0 收藏
  • 顶次数0
  • 上传人kuo08092
  • 文件大小0 KB
  • 时间2015-04-23
最近更新