`
wudixiaotie
  • 浏览: 131134 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

erlang关于Pattern Matching the Fields of a Map

 
阅读更多

```erlang

 

1> Henry8 = #{ class => king, born => 1491, died => 1547 }. #{ born => 1491, class=> king, died => 1547 }.
2> #{ born => B } = Henry8.
#{ born => 1491, class=> king, died => 1547 }.

3> B.
1491

```

这是erlang之父写的书的第二版,里面的代码,可是第二个命令行的语法是错误的,如果你按这个方式输入,会在shell里面报错:illegal pattern。应该用下面的写法。

```erlang

 

3> #{ born := B } = Henry8.

 

#{born => 1491,class => king,died => 1547}

```

0
0
分享到:
评论

相关推荐

    Erlang程序设计(英文版)

    Written by leaders of the international Erlang community -- and based on their training material -- Erlang Programming focuses on the language's syntax and semantics, and explains pattern matching, ...

    Introducing Erlang: Getting Started in Functional Programming

    Discover atoms, pattern matching, and guards: the foundations of your program structure Delve into the heart of Erlang processing with recursion, strings, lists, and higher-order functions Create ...

    Efficiency Guide (erlang)

    get the most speed out of binary pattern matching are no longer necessary. In fact, the ugly code is slower than the clean code (because the clean code has become faster, not because the uglier code ...

    <27>erlang record

    NULL 博文链接:https://ZacMa.iteye.com/blog/1976833

    [Erlang] Erlang 编程 第2版 (英文版)

    Joe Armstrong, creator of Erlang, introduces this powerful language in small steps, giving you a complete overview of Erlang and how to use it in common scenarios. You'll start with sequential ...

    Erlang and OTP in Action

    Erlang and OTP in Action teaches you to apply Erlang’s message passing model for concurrent programming–a completely different way of tackling the problem of parallel programming from the more ...

    Learn You Some Erlang for Great Good

    you'll tackle the real meat-and-potatoes of the language: concurrency, distributed computing, hot code loading, and all the other dark magic that makes Erlang such a hot topic among today's savvy ...

    Programming Erlang(Pragmatic,2ed,2013)

    A multi-user game, web site, cloud application, or networked database can have thousands of users all interacting at the same time. You need a powerful, industrial-strength tool to handle the really ...

    programming-erlang-software-for-a-concurrent-world

    Pragmatic Programmers,LLC was aware of a trademark claim,the designations have been printed in initial capital letters or in all capitals.The Pragmatic Starter Kit,The Pragmatic Programmer,Pragmatic ...

    erlang19安装包

    Erlang/OTP 19.1 is a service release containing mostly bug fixes, as well as a number of new features and characteristics improvements. Some highlights of the release are: erts: Improved dirty ...

    Erlang编程语言The Erlang Programming Language

    这是《 Erlang编程语言》的上一页,我们正在处理中,将那里的所有书籍都转换为新页面。 请再次检查此页面!!!

    erlang编程 Introducing Erlang

    erlang入门电子书 erlang编程 Introducing Erlang,作者Simon.St.Laurent

    erLang_win64_20.2安装包

    Erlang opt_win64 20.2 windows exe 安装包 Erlang 20.2 is the upcoming version of Erlang For Windows x64 installer 截至2018.01.25 groovy最新最稳定版本

    Erlang_to_C

    Turbo Erlang: Approaching the Speed of C

    erlang最新api

    erlang最新 api

    erlang_版本24.3.4.4

    erlang 安装包

    可在ubuntu上安装erlang的deb包

    This package contains the Erlang/OTP runtime implementation, which is configured and built with HiPE support (allows compiling to native code), and minimal set of Erlang applications: compiler - ...

    erlang 18-release

    kernel,stdlib,sasl: A mechanism for limiting the amount of text that the built-in error logger events will produce has been introduced. It is useful for limiting both the size of log files and the CPU...

    Introducing Elixir

    - Discover atoms, pattern matching, and guards: the foundations of your program structure, - Delve into the heart of Elixir processing with recursion, strings, lists, and higher-order functions, - ...

Global site tag (gtag.js) - Google Analytics