diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-05-12 16:23:00 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2024-05-12 16:23:00 +0900 |
commit | b911d2222f907d3fad397938e8f513ecfb4635b8 () | |
tree | 4b1dbb09896ae3ceb454d34a7532043ed898ad56 | |
parent | 5695c5df95460ed9949e1c8f8ca89b4a5c5cc4dd (diff) |
[Bug #20482] [DOC] Clarify about pattern maching guard clause
Guard clauses can only be used in `case` pattern matching statements, not in `=>`/`in` operators.
-rw-r--r-- | doc/syntax/pattern_matching.rdoc | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -422,7 +422,8 @@ These core and library classes implement deconstruction: == Guard clauses -+if+ can be used to attach an additional condition (guard clause) when the pattern matches. This condition may use bound variables: case [1, 2] in a, b if b == a*2 @@ -450,6 +451,11 @@ These core and library classes implement deconstruction: end #=> "matched" == Appendix A. Pattern syntax Approximate syntax is: |