各种编程语言的模式匹配

XiLaiTL小于 1 分钟

各种编程语言的模式匹配

Csharp https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/patternsopen in new window

Scala https://docs.scala-lang.org/zh-cn/tour/pattern-matching.htmlopen in new window

F# https://learn.microsoft.com/zh-cn/dotnet/fsharp/language-reference/pattern-matchingopen in new window

Haskell https://doc.yonyoucloud.com/doc/real-world-haskell-cn/chp/3.html#id10open in new windowhttps://github.com/huangzworks/real-world-haskell-cn/open in new window

Idris https://github.com/running-grass/idris2-tutorial-zh/blob/3d6ffce95ee6e35f96a5b936229278a3b6b07f1e/translation/src/Tutorial/DataTypes.mdopen in new window

erlang https://www.w3cschool.cn/erlang/qik11p5y.htmlopen in new windowhttps://erldoc.comopen in new window

elixir https://elixir-development.github.io/ElixirDocs/lessons/basics/control-structures.htmlopen in new window

Rust https://kaisery.github.io/trpl-zh-cn/ch06-02-match.htmlopen in new window

Swift https://docs.swift.org/swift-book/documentation/the-swift-programming-language/patternsopen in new window

Zig https://ziglang.org/documentation/0.11.0/#switchopen in new window

Java https://dev.java/learn/pattern-matching/open in new window

Kotlin(并没有模式匹配) https://book.kotlincn.net/text/control-flow.htmlopen in new windowhttps://github.com/Kotlin/KEEP/issues/371open in new window

https://github.com/Kotlin/KEEP/blob/guards/proposals/guards.mdopen in new window

OCaml

https://ocaml.org/docs/tour-of-ocaml#pattern-matching-contdopen in new window

https://ocaml.org/docs/values-and-functions#pattern-matching-in-definitionsopen in new window

Moonbit https://www.moonbitlang.cn/docs/syntax#模式匹配open in new window

python https://docs.python.org/3/tutorial/controlflow.html#match-statementsopen in new window

上次编辑于:
贡献者: XiLaiTL