docs: rewrite patterns documentation#9546
Conversation
orizi
left a comment
There was a problem hiding this comment.
@orizi made 2 comments.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @LarryArnault45).
docs/reference/src/components/cairo/modules/language_constructs/pages/patterns.adoc line 1 at r1 (raw file):
= Patterns
limit lines to 100 chars.
docs/reference/src/components/cairo/modules/language_constructs/pages/patterns.adoc line 14 at r1 (raw file):
Cairo supports two categories of patterns: * **Refutable patterns** — May fail to match (used in `match` arms)
and let ... else { ... }; statements as well. also have such examples.
|
Done. Added |
34b5fbc to
1761863
Compare
orizi
left a comment
There was a problem hiding this comment.
@orizi reviewed 1 file and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @LarryArnault45).
orizi
left a comment
There was a problem hiding this comment.
@orizi resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @LarryArnault45).
Summary
Rewrote the patterns documentation to provide a comprehensive explanation of pattern matching types, refutability, and usage examples.
Type of change
Please check one:
Why is this change needed?
The previous file was just a list of raw syntax examples without any explanation, making it difficult for users to understand how to use patterns effectively.
What was the behavior or documentation before?
The file contained a few lines of unexplained code snippets.
What is the behavior or documentation after?
The file now details different pattern types (wildcard, identifier, struct, enum), explains the difference between refutable and irrefutable patterns, and provides clear usage contexts for
letandmatch.Related issue or discussion (if any)
Additional context