logo
  • 教程列表
  • SO官方文檔
  • 模式匹配
    • 列表上的模式匹配
    • 在地圖上匹配的模式
    • 元組
    • 模式匹配功能
    • 使用模式匹配獲取列表的總和
    • 匿名函式
    • 模式匹配匿名函式
  1. StackOverflow 文件
  2. Elixir Language 教程
  3. 模式匹配
  4. 在地圖上匹配的模式

在地圖上匹配的模式

Created: November-22, 2018

%{username: username} = %{username: "John Doe", id: 1}
# username == "John Doe"
%{username: username, id: 2} = %{username: "John Doe", id: 1}
** (MatchError) no match of right hand side value: %{id: 1, username: "John Doe"}
  • 元組
  • 列表上的模式匹配

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明